From ea45826be6d4813fb18ed6f02b3bd7213cd810fe Mon Sep 17 00:00:00 2001 From: Philippe-Cholet Date: Tue, 7 Nov 2023 11:49:54 +0100 Subject: [PATCH] `Groups` and `Chunks` laziness `GroupBy` and `IntoChunks` are not iterators themselves but implement `IntoIterator` instead. Then `Groups` and `Chunks` are iterators. All four are lazy and must be used. --- tests/laziness.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/laziness.rs b/tests/laziness.rs index 68b065a77..9278e6061 100644 --- a/tests/laziness.rs +++ b/tests/laziness.rs @@ -72,11 +72,18 @@ must_use_tests! { let _ = Panicking.batching(Iterator::next); } group_by { + // GroupBy let _ = Panicking.group_by(|x| *x); + // Groups + let _ = Panicking.group_by(|x| *x).into_iter(); } chunks { + // IntoChunks let _ = Panicking.chunks(1); let _ = Panicking.chunks(2); + // Chunks + let _ = Panicking.chunks(1).into_iter(); + let _ = Panicking.chunks(2).into_iter(); } tuple_windows { let _ = Panicking.tuple_windows::<(_,)>();