7cdeac5773
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. |
||
---|---|---|
.. | ||
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 | ||
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 | ||
utils.rs | ||
while_immutable_condition.rs | ||
while_let_loop.rs | ||
while_let_on_iterator.rs |