From 214146dbc86157ad9a6a22c185a90c15ec882d4a Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Wed, 6 Mar 2024 11:41:26 -0500 Subject: [PATCH] Tweak solution to iter exercise Because .zip() is limited to the shorter length, the .take() call here is unnecessary --- src/iterators/exercise.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iterators/exercise.rs b/src/iterators/exercise.rs index c3b4a41e860..2d978607334 100644 --- a/src/iterators/exercise.rs +++ b/src/iterators/exercise.rs @@ -27,7 +27,7 @@ where // ANCHOR_END: offset_differences let a = (&values).into_iter(); let b = (&values).into_iter().cycle().skip(offset); - a.zip(b).map(|(a, b)| *b - *a).take(values.len()).collect() + a.zip(b).map(|(a, b)| *b - *a).collect() } // ANCHOR: unit-tests