slippy-cli 0.1.0

AI Linter for Rust projects
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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