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.
14
14
15
15
[dependencies ]
16
16
futures-core = " 0.3.1"
17
- pin-utils = " 0.1.0-alpha.4"
18
17
19
18
[dev-dependencies ]
20
19
async-std = { version = " 1.0.1" , features = [" attributes" ] }
Original file line number Diff line number Diff line change 1
1
use std:: future:: Future ;
2
2
use std:: io;
3
3
use std:: mem:: { self , ManuallyDrop } ;
4
+ use std:: pin:: Pin ;
4
5
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
5
6
use std:: sync:: Arc ;
6
7
use std:: task:: { Context , RawWaker , RawWakerVTable , Waker } ;
7
8
use std:: thread;
8
9
use std:: thread:: Thread ;
9
10
use std:: time:: Instant ;
10
11
11
- use pin_utils:: pin_mut;
12
-
13
12
use crate :: { Timer , TimerHandle } ;
14
13
15
14
pub struct HelperThread {
@@ -56,13 +55,12 @@ impl Drop for HelperThread {
56
55
}
57
56
}
58
57
59
- fn run ( timer : Timer , done : Arc < AtomicBool > ) {
58
+ fn run ( mut timer : Timer , done : Arc < AtomicBool > ) {
60
59
let waker = current_thread_waker ( ) ;
61
60
let mut cx = Context :: from_waker ( & waker) ;
62
61
63
- pin_mut ! ( timer) ;
64
62
while !done. load ( Ordering :: SeqCst ) {
65
- let _ = timer . as_mut ( ) . poll ( & mut cx) ;
63
+ let _ = Pin :: new ( & mut timer ) . poll ( & mut cx) ;
66
64
67
65
timer. advance ( ) ;
68
66
match timer. next_event ( ) {
You can’t perform that action at this time.
0 commit comments