forked from ROMEO/nexosim
Fix clippy warnings after version update
This commit is contained in:
parent
97c855293d
commit
d63bcdf4f0
@ -33,7 +33,7 @@ pub(super) struct MessageBorrow<'a, T: ?Sized> {
|
|||||||
stamp: usize,
|
stamp: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: ?Sized> Deref for MessageBorrow<'a, T> {
|
impl<T: ?Sized> Deref for MessageBorrow<'_, T> {
|
||||||
type Target = T;
|
type Target = T;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
@ -41,13 +41,13 @@ impl<'a, T: ?Sized> Deref for MessageBorrow<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: ?Sized> DerefMut for MessageBorrow<'a, T> {
|
impl<T: ?Sized> DerefMut for MessageBorrow<'_, T> {
|
||||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||||
&mut self.msg
|
&mut self.msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: ?Sized> Drop for MessageBorrow<'a, T> {
|
impl<T: ?Sized> Drop for MessageBorrow<'_, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let slot = &self.queue.buffer[self.index];
|
let slot = &self.queue.buffer[self.index];
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ impl<'a, T: ?Sized> Drop for MessageBorrow<'a, T> {
|
|||||||
slot.stamp.store(self.stamp, Ordering::Release);
|
slot.stamp.store(self.stamp, Ordering::Release);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl<'a, M> fmt::Debug for MessageBorrow<'a, M> {
|
impl<M> fmt::Debug for MessageBorrow<'_, M> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("MessageBorrow").finish_non_exhaustive()
|
f.debug_struct("MessageBorrow").finish_non_exhaustive()
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ where
|
|||||||
///
|
///
|
||||||
/// An arbitrary tag can be attached to the task, a clone of which will be
|
/// An arbitrary tag can be attached to the task, a clone of which will be
|
||||||
/// passed to the scheduling function each time it is called.
|
/// passed to the scheduling function each time it is called.
|
||||||
|
///
|
||||||
/// The returned `Runnable` must be scheduled by the user.
|
/// The returned `Runnable` must be scheduled by the user.
|
||||||
pub(crate) fn spawn<F, S, T>(
|
pub(crate) fn spawn<F, S, T>(
|
||||||
future: F,
|
future: F,
|
||||||
|
@ -70,7 +70,6 @@ use super::{Model, ProtoModel};
|
|||||||
/// }
|
/// }
|
||||||
/// impl Model for DelayedGreeter {}
|
/// impl Model for DelayedGreeter {}
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
// The self-scheduling caveat seems related to this issue:
|
// The self-scheduling caveat seems related to this issue:
|
||||||
// https://github.com/rust-lang/rust/issues/78649
|
// https://github.com/rust-lang/rust/issues/78649
|
||||||
pub struct Context<M: Model> {
|
pub struct Context<M: Model> {
|
||||||
|
@ -350,7 +350,7 @@ impl<'a, R> BroadcastFuture<'a, R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, R> Drop for BroadcastFuture<'a, R> {
|
impl<R> Drop for BroadcastFuture<'_, R> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Safety: this is safe since `self.futures` is never accessed after it
|
// Safety: this is safe since `self.futures` is never accessed after it
|
||||||
// is moved out.
|
// is moved out.
|
||||||
@ -361,7 +361,7 @@ impl<'a, R> Drop for BroadcastFuture<'a, R> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, R> Future for BroadcastFuture<'a, R> {
|
impl<R> Future for BroadcastFuture<'_, R> {
|
||||||
type Output = Result<(), SendError>;
|
type Output = Result<(), SendError>;
|
||||||
|
|
||||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
|
@ -736,7 +736,7 @@ impl<'a, T> RecycledFuture<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Drop for RecycledFuture<'a, T> {
|
impl<T> Drop for RecycledFuture<'_, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Return the box to the lender.
|
// Return the box to the lender.
|
||||||
//
|
//
|
||||||
@ -747,7 +747,7 @@ impl<'a, T> Drop for RecycledFuture<'a, T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Future for RecycledFuture<'a, T> {
|
impl<T> Future for RecycledFuture<'_, T> {
|
||||||
type Output = T;
|
type Output = T;
|
||||||
|
|
||||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
|
@ -42,7 +42,6 @@ const COUNTDOWN_ONE: u64 = 1 << 32;
|
|||||||
/// more than 1 to wake the parent task less frequently. For instance, if
|
/// more than 1 to wake the parent task less frequently. For instance, if
|
||||||
/// `notify_count` is set to the number of pending sub-tasks, the parent task
|
/// `notify_count` is set to the number of pending sub-tasks, the parent task
|
||||||
/// will only be woken once all subtasks have been woken.
|
/// will only be woken once all subtasks have been woken.
|
||||||
|
|
||||||
pub(crate) struct TaskSet {
|
pub(crate) struct TaskSet {
|
||||||
/// Set of all tasks, scheduled or not.
|
/// Set of all tasks, scheduled or not.
|
||||||
///
|
///
|
||||||
@ -355,7 +354,7 @@ pub(crate) struct TaskIterator<'a> {
|
|||||||
next_index: u32,
|
next_index: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Iterator for TaskIterator<'a> {
|
impl Iterator for TaskIterator<'_> {
|
||||||
type Item = usize;
|
type Item = usize;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
@ -380,7 +379,7 @@ impl<'a> Iterator for TaskIterator<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Drop for TaskIterator<'a> {
|
impl Drop for TaskIterator<'_> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Put all remaining scheduled tasks in the sleeping state.
|
// Put all remaining scheduled tasks in the sleeping state.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user