Hello, I'm having trouble figuring out how to write a pattern to destructure Windows.
Clippy complains about both of the following patterns,
#![warn(clippy::pattern_type_mismatch)]
struct Thing;
fn main() {
let list = vec![Thing, Thing];
let mut iter = list.windows(2);
while let Some([_a, _b]) = iter.next() { } // pattern_type_mismatch
while let Some(&[ref _a, ref _b]) = iter.next() { } // needless_borrowed_reference
}
What pattern should I be using and do you know of any good articles that might make me more confident in addressing pattern_type_mismatch warnings?
Thanks!