Closed

Description
Here is an example:
fn main() {
let v = vec![1, 2, 3];
{
let mut it = v.windows(2);
while let Some([x, y]) = it.next() {
println!("x: {}", x);
println!("y: {}", y);
}
}
/*
warning: this loop could be written as a `for` loop
--> src/main.rs:6:34
|
6 | while let Some([x, y]) = it.next() {
| ^^^^^^^^^ help: try: `for [x, y] in it { .. }`
|
= note: #[warn(clippy::while_let_on_iterator)] on by default
*/
// The Clippy suggestion fails to compile
/*
{
let mut it = v.windows(2);
for [x, y] in it {
println!("x: {}", x);
println!("y: {}", y);
}
}
*/
}