rust-lang/rust-clippy
Ver no GitHubNew lint: `while let Some(&x) = slice.iter().next()` is infinite loop
Open
#4.554 aberto em 19 de set. de 2019
A-lintL-correctnessL-suggestiongood first issue
Métricas do repositório
- Stars
- (10.406 stars)
- Métricas de merge de PR
- (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)
Description
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);
}
}