File tree 1 file changed +5
-3
lines changed 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl Waker {
42
42
/// `Arc` type and the safe `Wake` trait.
43
43
#[ inline]
44
44
pub unsafe fn new ( inner : NonNull < dyn UnsafeWake > ) -> Self {
45
- Waker { inner : inner }
45
+ Waker { inner }
46
46
}
47
47
48
48
/// Wake up the task associated with this `Waker`.
@@ -120,7 +120,7 @@ impl LocalWaker {
120
120
/// on the current thread.
121
121
#[ inline]
122
122
pub unsafe fn new ( inner : NonNull < dyn UnsafeWake > ) -> Self {
123
- LocalWaker { inner : inner }
123
+ LocalWaker { inner }
124
124
}
125
125
126
126
/// Wake up the task associated with this `LocalWaker`.
@@ -159,7 +159,9 @@ impl LocalWaker {
159
159
impl From < LocalWaker > for Waker {
160
160
#[ inline]
161
161
fn from ( local_waker : LocalWaker ) -> Self {
162
- Waker { inner : local_waker. inner }
162
+ let inner = local_waker. inner ;
163
+ mem:: forget ( local_waker) ;
164
+ Waker { inner }
163
165
}
164
166
}
165
167
You can’t perform that action at this time.
0 commit comments