File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1040,14 +1040,15 @@ where
1040
1040
match self . state {
1041
1041
FuseState :: Start => {
1042
1042
self . it . advance ( ) ;
1043
- self . state = match self . it . get ( ) {
1044
- Some ( _) => FuseState :: Middle ,
1045
- None => FuseState :: End ,
1043
+ self . state = if self . it . is_done ( ) {
1044
+ FuseState :: End
1045
+ } else {
1046
+ FuseState :: Middle
1046
1047
} ;
1047
1048
}
1048
1049
FuseState :: Middle => {
1049
1050
self . it . advance ( ) ;
1050
- if let None = self . it . get ( ) {
1051
+ if self . it . is_done ( ) {
1051
1052
self . state = FuseState :: End ;
1052
1053
}
1053
1054
}
@@ -1059,7 +1060,7 @@ where
1059
1060
fn is_done ( & self ) -> bool {
1060
1061
match self . state {
1061
1062
FuseState :: Start | FuseState :: End => true ,
1062
- FuseState :: Middle => self . it . is_done ( ) ,
1063
+ FuseState :: Middle => false ,
1063
1064
}
1064
1065
}
1065
1066
@@ -1120,6 +1121,7 @@ where
1120
1121
}
1121
1122
}
1122
1123
}
1124
+
1123
1125
/// A streaming iterator that calls a function with element before yielding it.
1124
1126
#[ derive( Debug ) ]
1125
1127
pub struct Inspect < I , F > {
You can’t perform that action at this time.
0 commit comments