File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
futures-util/src/future/future Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
use core:: pin:: Pin ;
2
2
use futures_core:: future:: { FusedFuture , Future } ;
3
- use futures_core:: ready;
4
3
use futures_core:: task:: { Context , Poll } ;
5
4
use pin_project_lite:: pin_project;
6
5
@@ -81,13 +80,12 @@ impl<Fut: Future> Future for Fuse<Fut> {
81
80
type Output = Fut :: Output ;
82
81
83
82
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Fut :: Output > {
84
- Poll :: Ready ( match self . as_mut ( ) . project ( ) . inner . as_pin_mut ( ) {
85
- Some ( fut) => {
86
- let output = ready ! ( fut. poll( cx) ) ;
83
+ match self . as_mut ( ) . project ( ) . inner . as_pin_mut ( ) {
84
+ Some ( fut) => fut. poll ( cx) . map ( |output| {
87
85
self . project ( ) . inner . set ( None ) ;
88
86
output
89
- }
90
- None => return Poll :: Pending ,
91
- } )
87
+ } ) ,
88
+ None => Poll :: Pending ,
89
+ }
92
90
}
93
91
}
You can’t perform that action at this time.
0 commit comments