File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ impl Waker {
4242 /// `Arc` type and the safe `Wake` trait.
4343 #[ inline]
4444 pub unsafe fn new ( inner : NonNull < dyn UnsafeWake > ) -> Self {
45- Waker { inner : inner }
45+ Waker { inner }
4646 }
4747
4848 /// Wake up the task associated with this `Waker`.
@@ -120,7 +120,7 @@ impl LocalWaker {
120120 /// on the current thread.
121121 #[ inline]
122122 pub unsafe fn new ( inner : NonNull < dyn UnsafeWake > ) -> Self {
123- LocalWaker { inner : inner }
123+ LocalWaker { inner }
124124 }
125125
126126 /// Wake up the task associated with this `LocalWaker`.
@@ -159,7 +159,9 @@ impl LocalWaker {
159159impl From < LocalWaker > for Waker {
160160 #[ inline]
161161 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 }
163165 }
164166}
165167
You can’t perform that action at this time.
0 commit comments