mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Add test for needless_range_loop
issue
Closes #2277 This was fixed when we fixed #2542.
This commit is contained in:
parent
4b8700879c
commit
d067d0352b
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