1
1
//! Futures 0.1 / 0.3 shims
2
- //!
2
+ //!
3
3
4
4
#![ allow( missing_debug_implementations) ]
5
5
6
- use futures :: Future as Future01 ;
7
- use futures :: Poll as Poll01 ;
8
- use futures :: task as task01;
9
- use futures :: task:: Task as Task01 ;
10
- use futures :: executor:: { with_notify, NotifyHandle , Notify , UnsafeNotify } ;
6
+ use futures01 :: Future as Future01 ;
7
+ use futures01 :: Poll as Poll01 ;
8
+ use futures01 :: task as task01;
9
+ use futures01 :: task:: Task as Task01 ;
10
+ use futures01 :: executor:: { with_notify, NotifyHandle , Notify , UnsafeNotify } ;
11
11
12
12
use futures_core:: Future as Future03 ;
13
13
use futures_core:: TryFuture as TryFuture03 ;
@@ -25,7 +25,7 @@ use std::sync::Arc;
25
25
#[ derive( Debug ) ]
26
26
#[ must_use = "futures do nothing unless polled" ]
27
27
pub struct Compat < Fut , E > {
28
- crate inner : Fut ,
28
+ crate inner : Fut ,
29
29
crate executor : Option < E > ,
30
30
}
31
31
@@ -48,11 +48,11 @@ impl<T> Future03 for Compat<T, ()> where T: Future01 {
48
48
type Output = Result < T :: Item , T :: Error > ;
49
49
50
50
fn poll ( self : PinMut < Self > , cx : & mut task:: Context ) -> Poll03 < Self :: Output > {
51
- use futures :: Async ;
51
+ use futures01 :: Async ;
52
52
53
53
let notify = & WakerToHandle ( cx. waker ( ) ) ;
54
54
55
- with_notify ( notify, 0 , move || {
55
+ with_notify ( notify, 0 , move || {
56
56
unsafe {
57
57
match PinMut :: get_mut_unchecked ( self ) . inner . poll ( ) {
58
58
Ok ( Async :: Ready ( t) ) => Poll03 :: Ready ( Ok ( t) ) ,
@@ -106,7 +106,7 @@ impl<T, E> Future01 for Compat<T, E> where T: TryFuture03 + Unpin,
106
106
type Error = T :: Error ;
107
107
108
108
fn poll ( & mut self ) -> Poll01 < Self :: Item , Self :: Error > {
109
- use futures :: Async ;
109
+ use futures01 :: Async ;
110
110
111
111
let waker = current_as_waker ( ) ;
112
112
let mut cx = task:: Context :: new ( & waker, self . executor . as_mut ( ) . unwrap ( ) ) ;
0 commit comments