Skip to content

Commit ded12e8

Browse files
Tuple1Combinations::fold
1 parent b461287 commit ded12e8

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
@@ -675,6 +675,13 @@ impl<I: Iterator> Iterator for Tuple1Combination<I> {
675675
fn count(self) -> usize {
676676
self.iter.count()
677677
}
678+
679+
fn fold<B, F>(self, init: B, f: F) -> B
680+
where
681+
F: FnMut(B, Self::Item) -> B,
682+
{
683+
self.iter.map(|x| (x,)).fold(init, f)
684+
}
678685
}
679686

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

0 commit comments

Comments
 (0)