36 lines
1.1 KiB
Text
36 lines
1.1 KiB
Text
error: using `.zip()` with a range and `.len()`
|
|
--> tests/ui/range.rs:6:14
|
|
|
|
|
LL | let _x = v1.iter().zip(0..v1.len());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `v1.iter().enumerate()`
|
|
|
|
|
= note: the order of the element and the index will be swapped
|
|
= note: `-D clippy::range-zip-with-len` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::range_zip_with_len)]`
|
|
|
|
error: using `.zip()` with a range and `.len()`
|
|
--> tests/ui/range.rs:10:19
|
|
|
|
|
LL | for (e, i) in v1.iter().zip(0..v1.len()) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: use
|
|
|
|
|
LL - for (e, i) in v1.iter().zip(0..v1.len()) {
|
|
LL + for (i, e) in v1.iter().enumerate() {
|
|
|
|
|
|
|
error: using `.zip()` with a range and `.len()`
|
|
--> tests/ui/range.rs:16:5
|
|
|
|
|
LL | v1.iter().zip(0..v1.len()).for_each(|(e, i)| {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: use
|
|
|
|
|
LL - v1.iter().zip(0..v1.len()).for_each(|(e, i)| {
|
|
LL + v1.iter().enumerate().for_each(|(i, e)| {
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|