From a90d3414ced71f17332a03462be792c50573d3b0 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet Date: Tue, 3 Oct 2023 11:20:34 +0200 Subject: [PATCH] `Tuple1Combinations::fold` --- src/adaptors/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/adaptors/mod.rs b/src/adaptors/mod.rs index e57867e06..6006d5f42 100644 --- a/src/adaptors/mod.rs +++ b/src/adaptors/mod.rs @@ -675,6 +675,13 @@ impl Iterator for Tuple1Combination { fn count(self) -> usize { self.iter.count() } + + fn fold(self, init: B, f: F) -> B + where + F: FnMut(B, Self::Item) -> B, + { + self.iter.map(|x| (x,)).fold(init, f) + } } impl HasCombination for (I::Item,) {