rust-lang/rust-clippy
Vedi su GitHubNew lint: `while let Some(&x) = slice.iter().next()` is infinite loop
Open
#4554 aperta il 19 set 2019
A-lintL-correctnessL-suggestiongood first issue
Metriche repository
- Star
- (10.406 star)
- Metriche merge PR
- (Merge medio 19g 22h) (113 PR mergiate in 30 g)
Descrizione
This code is an infinite loop: (Do not run this in playpen)
fn main() {
let a = [1, 2, 3];
while let Some(&x) = a.iter().next() {
println!("{:?}", x);
}
}