Clippy::pattern_type_mismatch when destructuring Windows<T>

Hello, I'm having trouble figuring out how to write a pattern to destructure Windows.

Clippy complains about both of the following patterns,

struct Thing;
fn main() {
    let list = vec![Thing, Thing];
    let mut iter =;
    while let Some([_a, _b]) = { } // pattern_type_mismatch
    while let Some(&[ref _a, ref _b]) = { } // 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?



Sigh, I was getting suspicious that there wasn't a resolution without quelling one warning or the other. Oh well. Thanks for the link!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.