File tree Expand file tree Collapse file tree 5 files changed +4
-33
lines changed Expand file tree Collapse file tree 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-
51macro_rules! ready {
62 ( $e: expr $( , ) ?) => {
73 match $e {
@@ -10,28 +6,3 @@ macro_rules! ready {
106 }
117 } ;
128}
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;
21use crate :: io:: Close ;
2+ use std:: future:: poll_fn;
33
44use std:: cell:: RefCell ;
55use std:: os:: unix:: io:: { FromRawFd , RawFd } ;
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl Runtime {
104104 tokio:: pin!( future) ;
105105
106106 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| {
108108 // assert!(drive.as_mut().poll(cx).is_pending());
109109 future. as_mut ( ) . poll ( cx)
110110 } ) ) )
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ async fn poll_once(future: impl std::future::Future) {
133133
134134 pin ! ( future) ;
135135
136- future:: poll_fn ( |cx| {
136+ std :: future:: poll_fn ( |cx| {
137137 assert ! ( future. as_mut( ) . poll( cx) . is_pending( ) ) ;
138138 Poll :: Ready ( ( ) )
139139 } )
Original file line number Diff line number Diff line change @@ -287,7 +287,7 @@ fn tempfile() -> NamedTempFile {
287287}
288288
289289async fn poll_once ( future : impl std:: future:: Future ) {
290- use future:: poll_fn;
290+ use std :: future:: poll_fn;
291291 // use std::future::Future;
292292 use std:: task:: Poll ;
293293 use tokio:: pin;
You can’t perform that action at this time.
0 commit comments