File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ impl<const N: usize> ReadinessArray<N> {
62
62
/// Set the parent `Waker`. This needs to be called at the start of every
63
63
/// `poll` function.
64
64
pub ( crate ) fn set_waker ( & mut self , parent_waker : & Waker ) {
65
- self . parent_waker = Some ( parent_waker. clone ( ) ) ;
65
+ match & mut self . parent_waker {
66
+ Some ( prev) => prev. clone_from ( parent_waker) ,
67
+ None => self . parent_waker = Some ( parent_waker. clone ( ) ) ,
68
+ }
66
69
}
67
70
}
Original file line number Diff line number Diff line change @@ -74,7 +74,10 @@ impl ReadinessVec {
74
74
/// Set the parent `Waker`. This needs to be called at the start of every
75
75
/// `poll` function.
76
76
pub ( crate ) fn set_waker ( & mut self , parent_waker : & Waker ) {
77
- self . parent_waker = Some ( parent_waker. clone ( ) ) ;
77
+ match & mut self . parent_waker {
78
+ Some ( prev) => prev. clone_from ( parent_waker) ,
79
+ None => self . parent_waker = Some ( parent_waker. clone ( ) ) ,
80
+ }
78
81
}
79
82
80
83
/// Resize `readiness` to the new length.
You can’t perform that action at this time.
0 commit comments