mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
Auto merge of #5798 - mikerite:fix-2277-2, r=yaahc
Add test for `needless_range_loop` issue Closes #2277 This was fixed when we fixed #2542. changelog: none
This commit is contained in:
commit
84cdce01cb
1 changed files with 10 additions and 0 deletions
|
@ -83,3 +83,13 @@ fn main() {
|
|||
println!("{}", arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
mod issue2277 {
|
||||
pub fn example(list: &[[f64; 3]]) {
|
||||
let mut x: [f64; 3] = [10.; 3];
|
||||
|
||||
for i in 0..3 {
|
||||
x[i] = list.iter().map(|item| item[i]).sum::<f64>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue