File tree Expand file tree Collapse file tree 2 files changed +13
-25
lines changed Expand file tree Collapse file tree 2 files changed +13
-25
lines changed Original file line number Diff line number Diff line change @@ -51,22 +51,16 @@ where
5151 let mut this = self . project ( ) ;
5252 loop {
5353 if let Some ( inner) = this. inner_stream . as_mut ( ) . as_pin_mut ( ) {
54- let next_item = futures_core:: ready!( inner. poll_next( cx) ) ;
55-
56- if next_item. is_some ( ) {
57- return Poll :: Ready ( next_item) ;
58- } else {
59- this. inner_stream . set ( None ) ;
54+ match futures_core:: ready!( inner. poll_next( cx) ) {
55+ item @ Some ( _) => return Poll :: Ready ( item) ,
56+ None => this. inner_stream . set ( None ) ,
6057 }
6158 }
6259
63- let inner = futures_core:: ready!( this. stream. as_mut( ) . poll_next( cx) ) ;
64-
65- if inner. is_some ( ) {
66- this. inner_stream . set ( inner. map ( IntoStream :: into_stream) ) ;
67- } else {
68- return Poll :: Ready ( None ) ;
60+ match futures_core:: ready!( this. stream. as_mut( ) . poll_next( cx) ) {
61+ inner @ Some ( _) => this. inner_stream . set ( inner. map ( IntoStream :: into_stream) ) ,
62+ None => return Poll :: Ready ( None ) ,
6963 }
7064 }
7165 }
72- }
66+ }
Original file line number Diff line number Diff line change @@ -52,21 +52,15 @@ where
5252 let mut this = self . project ( ) ;
5353 loop {
5454 if let Some ( inner) = this. inner_stream . as_mut ( ) . as_pin_mut ( ) {
55- let next_item = futures_core:: ready!( inner. poll_next( cx) ) ;
56-
57- if next_item. is_some ( ) {
58- return Poll :: Ready ( next_item) ;
59- } else {
60- this. inner_stream . set ( None ) ;
55+ match futures_core:: ready!( inner. poll_next( cx) ) {
56+ item @ Some ( _) => return Poll :: Ready ( next_item) ,
57+ None => this. inner_stream . set ( None ) ,
6158 }
6259 }
6360
64- let inner = futures_core:: ready!( this. stream. as_mut( ) . poll_next( cx) ) ;
65-
66- if inner. is_some ( ) {
67- this. inner_stream . set ( inner. map ( IntoStream :: into_stream) ) ;
68- } else {
69- return Poll :: Ready ( None ) ;
61+ match futures_core:: ready!( this. stream. as_mut( ) . poll_next( cx) ) {
62+ inner @ Some ( _) => this. inner_stream . set ( inner. map ( IntoStream :: into_stream) ) ,
63+ None => Poll :: Ready ( None ) ,
7064 }
7165 }
7266 }
You can’t perform that action at this time.
0 commit comments