File tree 5 files changed +4
-33
lines changed
5 files changed +4
-33
lines changed Original file line number Diff line number Diff line change 1
- use std:: future:: Future ;
2
- use std:: pin:: Pin ;
3
- use std:: task:: { Context , Poll } ;
4
-
5
1
macro_rules! ready {
6
2
( $e: expr $( , ) ?) => {
7
3
match $e {
@@ -10,28 +6,3 @@ macro_rules! ready {
10
6
}
11
7
} ;
12
8
}
13
-
14
- #[ must_use = "futures do nothing unless you `.await` or poll them" ]
15
- pub ( crate ) struct PollFn < F > {
16
- f : F ,
17
- }
18
-
19
- impl < F > Unpin for PollFn < F > { }
20
-
21
- pub ( crate ) fn poll_fn < T , F > ( f : F ) -> PollFn < F >
22
- where
23
- F : FnMut ( & mut Context < ' _ > ) -> Poll < T > ,
24
- {
25
- PollFn { f }
26
- }
27
-
28
- impl < T , F > Future for PollFn < F >
29
- where
30
- F : FnMut ( & mut Context < ' _ > ) -> Poll < T > ,
31
- {
32
- type Output = T ;
33
-
34
- fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < T > {
35
- ( self . f ) ( cx)
36
- }
37
- }
Original file line number Diff line number Diff line change 1
- use crate :: future:: poll_fn;
2
1
use crate :: io:: Close ;
2
+ use std:: future:: poll_fn;
3
3
4
4
use std:: cell:: RefCell ;
5
5
use std:: os:: unix:: io:: { FromRawFd , RawFd } ;
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl Runtime {
104
104
tokio:: pin!( future) ;
105
105
106
106
self . rt
107
- . block_on ( self . local . run_until ( crate :: future:: poll_fn ( |cx| {
107
+ . block_on ( self . local . run_until ( std :: future:: poll_fn ( |cx| {
108
108
// assert!(drive.as_mut().poll(cx).is_pending());
109
109
future. as_mut ( ) . poll ( cx)
110
110
} ) ) )
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ async fn poll_once(future: impl std::future::Future) {
133
133
134
134
pin ! ( future) ;
135
135
136
- future:: poll_fn ( |cx| {
136
+ std :: future:: poll_fn ( |cx| {
137
137
assert ! ( future. as_mut( ) . poll( cx) . is_pending( ) ) ;
138
138
Poll :: Ready ( ( ) )
139
139
} )
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ fn tempfile() -> NamedTempFile {
287
287
}
288
288
289
289
async fn poll_once ( future : impl std:: future:: Future ) {
290
- use future:: poll_fn;
290
+ use std :: future:: poll_fn;
291
291
// use std::future::Future;
292
292
use std:: task:: Poll ;
293
293
use tokio:: pin;
You can’t perform that action at this time.
0 commit comments