File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " streaming-iterator"
3
- version = " 0.1.4 "
3
+ version = " 0.1.5 "
4
4
authors = [" Steven Fackler <sfackler@gmail.com>" ]
5
5
license = " MIT/Apache-2.0"
6
6
description = " Streaming iterators"
Original file line number Diff line number Diff line change @@ -1107,6 +1107,19 @@ where
1107
1107
1108
1108
None
1109
1109
}
1110
+
1111
+ #[ inline]
1112
+ fn fold < Acc , Fold > ( self , init : Acc , mut f : Fold ) -> Acc
1113
+ where
1114
+ Self : Sized ,
1115
+ Fold : FnMut ( Acc , Self :: Item ) -> Acc ,
1116
+ {
1117
+ let mut map = self . f ;
1118
+ self . it . fold ( init, move |acc, item| match map ( item) {
1119
+ Some ( mapped) => f ( acc, mapped) ,
1120
+ None => acc,
1121
+ } )
1122
+ }
1110
1123
}
1111
1124
1112
1125
impl < I , B , F > DoubleEndedIterator for FilterMapDeref < I , F >
@@ -1375,6 +1388,16 @@ where
1375
1388
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1376
1389
self . it . size_hint ( )
1377
1390
}
1391
+
1392
+ #[ inline]
1393
+ fn fold < Acc , Fold > ( self , init : Acc , mut f : Fold ) -> Acc
1394
+ where
1395
+ Self : Sized ,
1396
+ Fold : FnMut ( Acc , Self :: Item ) -> Acc ,
1397
+ {
1398
+ let mut map = self . f ;
1399
+ self . it . fold ( init, move |acc, item| f ( acc, map ( item) ) )
1400
+ }
1378
1401
}
1379
1402
1380
1403
impl < I , B , F > DoubleEndedIterator for MapDeref < I , F >
You can’t perform that action at this time.
0 commit comments