Skip to content

Commit db0311c

Browse files
Philippe-Choletphimuemue
authored andcommitted
RepeatN::rfold
1 parent 7c5a5c0 commit db0311c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/repeatn.rs

Lines changed: 8 additions & 0 deletions
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)