Skip to content

Commit be46042

Browse files
RepeatN::rfold
1 parent 33afea5 commit be46042

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
@@ -70,6 +70,14 @@ where
7070
fn next_back(&mut self) -> Option<Self::Item> {
7171
self.next()
7272
}
73+
74+
#[inline]
75+
fn rfold<B, F>(self, init: B, f: F) -> B
76+
where
77+
F: FnMut(B, Self::Item) -> B,
78+
{
79+
self.fold(init, f)
80+
}
7381
}
7482

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

0 commit comments

Comments
 (0)