2023-11-02 16:35:56 +00:00
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/unused_enumerate_index.rs:12:19
|
2023-11-02 16:35:56 +00:00
|
|
|
|
|
|
|
|
LL | for (_, x) in v.iter().enumerate() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unused-enumerate-index` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unused_enumerate_index)]`
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL | for x in v.iter() {
|
|
|
|
| ~ ~~~~~~~~
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
2024-03-21 21:20:40 +00:00
|
|
|
--> tests/ui/unused_enumerate_index.rs:59:19
|
2023-11-02 16:35:56 +00:00
|
|
|
|
|
|
|
|
LL | for (_, x) in dummy.enumerate() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL | for x in dummy {
|
|
|
|
| ~ ~~~~~
|
|
|
|
|
2024-03-21 21:20:40 +00:00
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:63:39
|
|
|
|
|
|
|
|
|
LL | let _ = vec![1, 2, 3].into_iter().enumerate().map(|(_, x)| println!("{x}"));
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL - let _ = vec![1, 2, 3].into_iter().enumerate().map(|(_, x)| println!("{x}"));
|
|
|
|
LL + let _ = vec![1, 2, 3].into_iter().map(|x| println!("{x}"));
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:65:39
|
|
|
|
|
|
|
|
|
LL | let p = vec![1, 2, 3].into_iter().enumerate();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL ~ let p = vec![1, 2, 3].into_iter();
|
|
|
|
LL ~ p.map(|x| println!("{x}"));
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:86:17
|
|
|
|
|
|
|
|
|
LL | _ = mac2!().enumerate().map(|(_, _v)| {});
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL - _ = mac2!().enumerate().map(|(_, _v)| {});
|
|
|
|
LL + _ = mac2!().map(|_v| {});
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:94:39
|
|
|
|
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
|
|
LL ~ let x = v.map(|x: i32| x).sum::<i32>();
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:99:39
|
|
|
|
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
|
|
LL ~ let x = v.map(|x: i32| x).sum::<i32>();
|
|
|
|
|
|
|
|
|
|
|
|
|
error: you seem to use `.enumerate()` and immediately discard the index
|
|
|
|
--> tests/ui/unused_enumerate_index.rs:103:39
|
|
|
|
|
|
|
|
|
LL | let v = [1, 2, 3].iter().copied().enumerate();
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: remove the `.enumerate()` call
|
|
|
|
|
|
|
|
|
LL ~ let v = [1, 2, 3].iter().copied();
|
|
|
|
LL ~ let x = v.map(|x| x).sum::<i32>();
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2023-11-02 16:35:56 +00:00
|
|
|
|