File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
use failure:: Error ;
2
2
use futures:: stream:: poll_fn;
3
3
use futures:: { Async , Future , Poll , Stream } ;
4
- use futures03:: compat:: Compat ;
5
4
use lazy_static:: lazy_static;
6
5
use mockall:: predicate:: * ;
7
6
use mockall:: * ;
@@ -578,7 +577,7 @@ where
578
577
let mut pending_event: Option < StoreEvent > = None ;
579
578
let mut source = self . source . fuse ( ) ;
580
579
let mut had_err = false ;
581
- let mut delay = Compat :: new ( tokio:: time:: delay_for ( interval) . map ( Result :: < _ , ( ) > :: Ok ) ) ;
580
+ let mut delay = tokio:: time:: delay_for ( interval) . unit_error ( ) . compat ( ) ;
582
581
let logger = logger. clone ( ) ;
583
582
584
583
let source = Box :: new ( poll_fn ( move || -> Poll < Option < StoreEvent > , ( ) > {
@@ -605,7 +604,7 @@ where
605
604
// Timer errors are harmless. Treat them as if the timer had
606
605
// become ready.
607
606
Ok ( Async :: Ready ( ( ) ) ) | Err ( _) => {
608
- delay = Compat :: new ( tokio:: time:: delay_for ( interval) . map ( Ok ) ) ;
607
+ delay = tokio:: time:: delay_for ( interval) . unit_error ( ) . compat ( ) ;
609
608
true
610
609
}
611
610
} ;
Original file line number Diff line number Diff line change @@ -151,7 +151,6 @@ where
151
151
F : Fn ( ) -> R + Send ,
152
152
R : Future < Item = I , Error = E > + Send ,
153
153
{
154
- use futures03:: compat:: Compat ;
155
154
use futures03:: future:: TryFutureExt ;
156
155
157
156
let operation_name = self . inner . operation_name ;
@@ -170,12 +169,11 @@ where
170
169
log_after,
171
170
limit_opt,
172
171
move || {
173
- Compat :: new (
174
- try_it ( )
175
- . timeout ( timeout)
176
- . map_err ( |_| TimeoutError :: Elapsed )
177
- . and_then ( |res| futures03:: future:: ready ( res. map_err ( TimeoutError :: Inner ) ) ) ,
178
- )
172
+ try_it ( )
173
+ . timeout ( timeout)
174
+ . map_err ( |_| TimeoutError :: Elapsed )
175
+ . and_then ( |res| futures03:: future:: ready ( res. map_err ( TimeoutError :: Inner ) ) )
176
+ . compat ( )
179
177
} ,
180
178
)
181
179
}
You can’t perform that action at this time.
0 commit comments