rust/clippy_lints/src/loops
Ethiraric 7cdeac5773 [unused_enumerate_index]: trigger on method calls
The lint used to check for patterns looking like:
```rs
for (_, x) in some_iter.enumerate() {
    // Index is ignored
}
```

This commit further checks for chained method calls constructs where we
can detect that the index is unused. Currently, this checks only for the
following patterns:
```rs
some_iter.enumerate().map_function(|(_, x)| ..)
let x = some_iter.enumerate();
x.map_function(|(_, x)| ..)
```
where `map_function` is one of `all`, `any`, `filter_map`, `find_map`,
`flat_map`, `for_each` or `map`.

Fixes #12411.
2024-03-13 20:28:01 +01:00
..
empty_loop.rs
explicit_counter_loop.rs
explicit_into_iter_loop.rs
explicit_iter_loop.rs
for_kv_map.rs
infinite_loop.rs
iter_next_loop.rs
manual_find.rs
manual_flatten.rs
manual_memcpy.rs fix: manual_memcpy wrong suggestion for multi dimensional arrays 2024-02-28 03:48:49 +09:00
manual_while_let_some.rs
missing_spin_loop.rs
mod.rs
mut_range_bound.rs
needless_range_loop.rs
never_loop.rs
same_item_push.rs
single_element_loop.rs
unused_enumerate_index.rs [unused_enumerate_index]: trigger on method calls 2024-03-13 20:28:01 +01:00
utils.rs
while_immutable_condition.rs
while_let_loop.rs
while_let_on_iterator.rs