rust-lang/rust-clippy
GitHub で見るNew lint: `while let Some(&x) = slice.iter().next()` is infinite loop
Open
#4,554 opened on 2019年9月19日
A-lintL-correctnessL-suggestiongood first issue
Repository metrics
- Stars
- (10,406 stars)
- PR merge metrics
- (平均マージ 19d 22h) (30d で 113 merged PRs)
説明
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);
}
}