diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /vendor/itertools/src/intersperse.rs | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/itertools/src/intersperse.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vendor/itertools/src/intersperse.rs b/vendor/itertools/src/intersperse.rs index 2c660d492..10a3a5389 100644 --- a/vendor/itertools/src/intersperse.rs +++ b/vendor/itertools/src/intersperse.rs @@ -55,7 +55,7 @@ pub struct IntersperseWith<I, ElemF> peek: Option<I::Item>, } -/// Create a new IntersperseWith iterator +/// Create a new `IntersperseWith` iterator pub fn intersperse_with<I, ElemF>(iter: I, elt: ElemF) -> IntersperseWith<I, ElemF> where I: Iterator, { @@ -107,8 +107,7 @@ impl<I, ElemF> Iterator for IntersperseWith<I, ElemF> self.iter.fold(accum, |accum, x| { let accum = f(accum, element.generate()); - let accum = f(accum, x); - accum + f(accum, x) }) } } |