diff options
Diffstat (limited to 'vendor/itertools/src/intersperse.rs')
-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) }) } } |