Skip to content

Commit

Permalink
RepeatN::rfold
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Dec 14, 2023
1 parent 8540cbc commit 458fb2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/repeatn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ where
fn next_back(&mut self) -> Option<Self::Item> {
self.next()
}

#[inline]
fn rfold<B, F>(self, init: B, f: F) -> B
where
F: FnMut(B, Self::Item) -> B,
{
self.fold(init, f)
}
}

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

0 comments on commit 458fb2d

Please sign in to comment.