diff --git a/core/src/nodes/tasks/manager.rs b/core/src/nodes/tasks/manager.rs index aff72bd9..96e469a7 100644 --- a/core/src/nodes/tasks/manager.rs +++ b/core/src/nodes/tasks/manager.rs @@ -177,7 +177,7 @@ impl Manager { let task = Box::pin(Task::new(task_id, self.events_tx.clone(), rx, future, handler)); if let Some(threads_pool) = &mut self.threads_pool { - threads_pool.spawn(task).expect("spawning a task on a threads pool never fails; qed"); + threads_pool.spawn(task).expect("spawning a task on a thread pool never fails; qed"); } else { self.local_spawns.push(task); } @@ -209,10 +209,6 @@ impl Manager { let (tx, rx) = mpsc::channel(4); self.tasks.insert(task_id, TaskInfo { sender: tx, user_data }); - // TODO: we use `Pin>` instead of just `Pending` because `Pending` doesn't - // implement `Unpin` even though it should ; this is just a dummy template parameter and - // the `Box` is never actually created, so this has no repercusion whatsoever - // see https://github.com/rust-lang-nursery/futures-rs/pull/1746 let task: Task>>, _, _, _, _, _, _> = Task::node(task_id, self.events_tx.clone(), rx, HandledNode::new(muxer, handler)); diff --git a/muxers/mplex/src/lib.rs b/muxers/mplex/src/lib.rs index 36ccc747..e3a9ff06 100644 --- a/muxers/mplex/src/lib.rs +++ b/muxers/mplex/src/lib.rs @@ -249,7 +249,7 @@ impl ArcWake for Notifier { /// Processes elements in `inner` until one matching `filter` is found. /// -/// If `Pending` is returned, the waker is kept and notifier later, just like with any `Poll`. +/// If `Pending` is returned, the waker is kept and notified later, just like with any `Poll`. /// `Ready(Ok())` is almost always returned. An error is returned if the stream is EOF. fn next_match(inner: &mut MultiplexInner, cx: &mut Context, mut filter: F) -> Poll> where C: AsyncRead + AsyncWrite + Unpin, diff --git a/swarm/src/lib.rs b/swarm/src/lib.rs index 1c455269..321d081f 100644 --- a/swarm/src/lib.rs +++ b/swarm/src/lib.rs @@ -343,7 +343,8 @@ where TBehaviour: NetworkBehaviour, type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - // We use a `this` variable to solve borrowing issues. + // We use a `this` variable because the compiler can't mutably borrow multiple times + // across a `Deref`. let this = &mut *self; loop {