File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1187,6 +1187,19 @@ where
1187
1187
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1188
1188
self . it . size_hint ( )
1189
1189
}
1190
+
1191
+ #[ inline]
1192
+ fn fold < Acc , Fold > ( self , init : Acc , mut fold : Fold ) -> Acc
1193
+ where
1194
+ Self : Sized ,
1195
+ Fold : FnMut ( Acc , & Self :: Item ) -> Acc ,
1196
+ {
1197
+ let mut f = self . f ;
1198
+ self . it . fold ( init, |acc, item| {
1199
+ f ( item) ;
1200
+ fold ( acc, item)
1201
+ } )
1202
+ }
1190
1203
}
1191
1204
1192
1205
impl < I , F > DoubleEndedStreamingIterator for Inspect < I , F >
@@ -1199,6 +1212,19 @@ where
1199
1212
( self . f ) ( item) ;
1200
1213
}
1201
1214
}
1215
+
1216
+ #[ inline]
1217
+ fn rfold < Acc , Fold > ( self , init : Acc , mut fold : Fold ) -> Acc
1218
+ where
1219
+ Self : Sized ,
1220
+ Fold : FnMut ( Acc , & Self :: Item ) -> Acc ,
1221
+ {
1222
+ let mut f = self . f ;
1223
+ self . it . rfold ( init, |acc, item| {
1224
+ f ( item) ;
1225
+ fold ( acc, item)
1226
+ } )
1227
+ }
1202
1228
}
1203
1229
1204
1230
/// A streaming iterator which transforms the elements of a streaming iterator.
You can’t perform that action at this time.
0 commit comments