Skip to content

Commit 458fb2d

Browse files
RepeatN::rfold
1 parent 8540cbc commit 458fb2d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/repeatn.rs

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ where
6868
fn next_back(&mut self) -> Option<Self::Item> {
6969
self.next()
7070
}
71+
72+
#[inline]
73+
fn rfold<B, F>(self, init: B, f: F) -> B
74+
where
75+
F: FnMut(B, Self::Item) -> B,
76+
{
77+
self.fold(init, f)
78+
}
7179
}
7280

7381
impl<A> ExactSizeIterator for RepeatN<A> where A: Clone {}

0 commit comments

Comments
 (0)