File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ Timeouts and intervals for futures.
1414
1515[dependencies ]
1616futures-core = " 0.3.1"
17- pin-utils = " 0.1.0-alpha.4"
1817
1918[dev-dependencies ]
2019async-std = { version = " 1.0.1" , features = [" attributes" ] }
Original file line number Diff line number Diff line change 11use std:: future:: Future ;
22use std:: io;
33use std:: mem:: { self , ManuallyDrop } ;
4+ use std:: pin:: Pin ;
45use std:: sync:: atomic:: { AtomicBool , Ordering } ;
56use std:: sync:: Arc ;
67use std:: task:: { Context , RawWaker , RawWakerVTable , Waker } ;
78use std:: thread;
89use std:: thread:: Thread ;
910use std:: time:: Instant ;
1011
11- use pin_utils:: pin_mut;
12-
1312use crate :: { Timer , TimerHandle } ;
1413
1514pub struct HelperThread {
@@ -56,13 +55,12 @@ impl Drop for HelperThread {
5655 }
5756}
5857
59- fn run ( timer : Timer , done : Arc < AtomicBool > ) {
58+ fn run ( mut timer : Timer , done : Arc < AtomicBool > ) {
6059 let waker = current_thread_waker ( ) ;
6160 let mut cx = Context :: from_waker ( & waker) ;
6261
63- pin_mut ! ( timer) ;
6462 while !done. load ( Ordering :: SeqCst ) {
65- let _ = timer . as_mut ( ) . poll ( & mut cx) ;
63+ let _ = Pin :: new ( & mut timer ) . poll ( & mut cx) ;
6664
6765 timer. advance ( ) ;
6866 match timer. next_event ( ) {
You can’t perform that action at this time.
0 commit comments