rust-lang/rust-clippy
在 GitHub 查看New lint: `while let Some(&x) = slice.iter().next()` is infinite loop
Open
#4,554 创建于 2019年9月19日
A-lintL-correctnessL-suggestiongood first issue
仓库指标
- Star
- (10,406 star)
- PR 合并指标
- (平均合并 19天 22小时) (30 天内合并 113 个 PR)
描述
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);
}
}