File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,12 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
359
359
#[ inline]
360
360
fn size_hint ( & self ) -> ( usize , Option < usize > ) { self . iter . size_hint ( ) }
361
361
362
+ fn fold < Acc , F > ( self , init : Acc , f : F ) -> Acc
363
+ where F : FnMut ( Acc , Self :: Item ) -> Acc ,
364
+ {
365
+ self . iter . rfold ( init, f)
366
+ }
367
+
362
368
#[ inline]
363
369
fn find < P > ( & mut self , predicate : P ) -> Option < Self :: Item >
364
370
where P : FnMut ( & Self :: Item ) -> bool
@@ -379,6 +385,12 @@ impl<I> DoubleEndedIterator for Rev<I> where I: DoubleEndedIterator {
379
385
#[ inline]
380
386
fn next_back ( & mut self ) -> Option < <I as Iterator >:: Item > { self . iter . next ( ) }
381
387
388
+ fn rfold < Acc , F > ( self , init : Acc , f : F ) -> Acc
389
+ where F : FnMut ( Acc , Self :: Item ) -> Acc ,
390
+ {
391
+ self . iter . fold ( init, f)
392
+ }
393
+
382
394
fn rfind < P > ( & mut self , predicate : P ) -> Option < Self :: Item >
383
395
where P : FnMut ( & Self :: Item ) -> bool
384
396
{
You can’t perform that action at this time.
0 commit comments