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
51
51
let mut this = self . project ( ) ;
52
52
loop {
53
53
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 ) ,
60
57
}
61
58
}
62
59
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 ) ,
69
63
}
70
64
}
71
65
}
72
- }
66
+ }
Original file line number Diff line number Diff line change @@ -52,21 +52,15 @@ where
52
52
let mut this = self . project ( ) ;
53
53
loop {
54
54
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 ) ,
61
58
}
62
59
}
63
60
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 ) ,
70
64
}
71
65
}
72
66
}
You can’t perform that action at this time.
0 commit comments