Skip to content

Commit 0c723b5

Browse files
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.
1 parent 5fa620e commit 0c723b5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/laziness.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,18 @@ must_use_tests! {
7272
let _ = Panicking.batching(Iterator::next);
7373
}
7474
group_by {
75+
// GroupBy
7576
let _ = Panicking.group_by(|x| *x);
77+
// Groups
78+
let _ = Panicking.group_by(|x| *x).into_iter();
7679
}
7780
chunks {
81+
// IntoChunks
7882
let _ = Panicking.chunks(1);
7983
let _ = Panicking.chunks(2);
84+
// Chunks
85+
let _ = Panicking.chunks(1).into_iter();
86+
let _ = Panicking.chunks(2).into_iter();
8087
}
8188
tuple_windows {
8289
let _ = Panicking.tuple_windows::<(_,)>();

0 commit comments

Comments
 (0)