Skip to content

Commit 61600f6

Browse files
committed
Delegate Iterator::try_fold for Iterators taken by reference
1 parent 0e9b465 commit 61600f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/iter/traits/iterator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,4 +2708,9 @@ impl<I: Iterator + ?Sized> Iterator for &mut I {
27082708
fn nth(&mut self, n: usize) -> Option<Self::Item> {
27092709
(**self).nth(n)
27102710
}
2711+
fn try_fold<B, F, R>(&mut self, init: B, mut f: F) -> R where
2712+
I: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Ok=B>
2713+
{
2714+
(**self).try_fold(init, f)
2715+
}
27112716
}

0 commit comments

Comments
 (0)