Skip to content

Commit

Permalink
add clone_from for channel
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelraz committed Nov 7, 2023
1 parent da0c28c commit dbbd00c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ impl<T> Stream for LocalReceiver<T> {
if channel.closed {
Poll::Ready(None)
} else {
channel.waker = Some(cx.waker().clone());
match &mut channel.waker {
Some(prev) => prev.clone_from(cx.waker()),
None => channel.waker = Some(cx.waker().clone())
}
Poll::Pending
}
}
Expand Down

0 comments on commit dbbd00c

Please sign in to comment.