Skip to content

Commit b743e2a

Browse files
Tuple1Combinations::fold
1 parent 318ae0a commit b743e2a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/adaptors/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,13 @@ impl<I: Iterator> Iterator for Tuple1Combination<I> {
691691
fn count(self) -> usize {
692692
self.iter.count()
693693
}
694+
695+
fn fold<B, F>(self, init: B, f: F) -> B
696+
where
697+
F: FnMut(B, Self::Item) -> B,
698+
{
699+
self.iter.map(|x| (x,)).fold(init, f)
700+
}
694701
}
695702

696703
impl<I: Iterator> HasCombination<I> for (I::Item,) {

0 commit comments

Comments
 (0)