mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Add a test for #398
This commit is contained in:
parent
387e0991e3
commit
e6b905d925
1 changed files with 5 additions and 0 deletions
|
@ -32,6 +32,11 @@ fn main() {
|
|||
println!("{} {}", vec[i], vec2[i]);
|
||||
}
|
||||
|
||||
for i in 0..vec.len() {
|
||||
//~^ ERROR `i` is only used to index `vec2`. Consider using `for item in vec2.iter().take(vec.len())`
|
||||
println!("{}", vec2[i]);
|
||||
}
|
||||
|
||||
for i in 5..vec.len() {
|
||||
//~^ ERROR `i` is only used to index `vec`. Consider using `for item in vec.iter().skip(5)`
|
||||
println!("{}", vec[i]);
|
||||
|
|
Loading…
Reference in a new issue