From 01406b3139c6dd34a5fe0f18ac3c32574bca6504 Mon Sep 17 00:00:00 2001 From: Philippe-Cholet Date: Tue, 3 Oct 2023 11:21:12 +0200 Subject: [PATCH] `TupleCombinations::fold` --- src/adaptors/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/adaptors/mod.rs b/src/adaptors/mod.rs index 90cf46eed..e57867e06 100644 --- a/src/adaptors/mod.rs +++ b/src/adaptors/mod.rs @@ -634,6 +634,13 @@ where fn count(self) -> usize { self.iter.count() } + + fn fold(self, init: B, f: F) -> B + where + F: FnMut(B, Self::Item) -> B, + { + self.iter.fold(init, f) + } } impl FusedIterator for TupleCombinations