warning: Unnecessary `contains` call on a collection being iterated over
╭▸ examples/lints/unnecessary_contains_in_loop/iterator.rs:5:38
│
5 │ v.iter().map(|i| i).filter(|i| v.contains(i)).for_each(|i| {
│ ━━━━━━━━━━━ method always returns `true` unless modified while iterating
│
╰ help: for further information visit https://sliman4.github.io/slippy/index.html#unnecessary_contains_in_loop
note: the collection is iterated here
╭▸ examples/lints/unnecessary_contains_in_loop/iterator.rs:5:5
│
5 │ v.iter().map(|i| i).filter(|i| v.contains(i)).for_each(|i| {
╰╴ ━━━━━━━━ iterating over this collection
help: try:
╭╴
5 - v.iter().map(|i| i).filter(|i| v.contains(i)).for_each(|i| {
5 + v.iter().map(|i| i).filter(|i| true).for_each(|i| {
╰╴
note: `warn(slippy::unnecessary_contains_in_loop)` on by default