|
1 | | -error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`. |
| 1 | +error: called `is_some()` after searching an `Iterator` with find |
2 | 2 | --> $DIR/search_is_some_fixable.rs:10:22 |
3 | 3 | | |
4 | 4 | LL | let _ = v.iter().find(|&x| *x < 0).is_some(); |
5 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)` |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x < 0)` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::search-is-some` implied by `-D warnings` |
8 | 8 |
|
9 | | -error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`. |
| 9 | +error: called `is_some()` after searching an `Iterator` with find |
10 | 10 | --> $DIR/search_is_some_fixable.rs:11:20 |
11 | 11 | | |
12 | 12 | LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less |
13 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)` |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| **y == x)` |
14 | 14 |
|
15 | | -error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`. |
| 15 | +error: called `is_some()` after searching an `Iterator` with find |
16 | 16 | --> $DIR/search_is_some_fixable.rs:12:20 |
17 | 17 | | |
18 | 18 | LL | let _ = (0..1).find(|x| *x == 0).is_some(); |
19 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)` |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0)` |
20 | 20 |
|
21 | | -error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`. |
| 21 | +error: called `is_some()` after searching an `Iterator` with find |
22 | 22 | --> $DIR/search_is_some_fixable.rs:13:22 |
23 | 23 | | |
24 | 24 | LL | let _ = v.iter().find(|x| **x == 0).is_some(); |
25 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)` |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 0)` |
26 | 26 |
|
27 | | -error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`. |
| 27 | +error: called `is_some()` after searching an `Iterator` with position |
28 | 28 | --> $DIR/search_is_some_fixable.rs:16:22 |
29 | 29 | | |
30 | 30 | LL | let _ = v.iter().position(|&x| x < 0).is_some(); |
31 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)` |
| 31 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)` |
32 | 32 |
|
33 | | -error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`. |
| 33 | +error: called `is_some()` after searching an `Iterator` with rposition |
34 | 34 | --> $DIR/search_is_some_fixable.rs:19:22 |
35 | 35 | | |
36 | 36 | LL | let _ = v.iter().rposition(|&x| x < 0).is_some(); |
37 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)` |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)` |
38 | 38 |
|
39 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 39 | +error: called `is_some()` after calling `find()` on a string |
40 | 40 | --> $DIR/search_is_some_fixable.rs:24:27 |
41 | 41 | | |
42 | 42 | LL | let _ = "hello world".find("world").is_some(); |
43 | | - | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains("world")` |
| 43 | + | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")` |
44 | 44 |
|
45 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 45 | +error: called `is_some()` after calling `find()` on a string |
46 | 46 | --> $DIR/search_is_some_fixable.rs:25:27 |
47 | 47 | | |
48 | 48 | LL | let _ = "hello world".find(&s2).is_some(); |
49 | | - | ^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2)` |
| 49 | + | ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)` |
50 | 50 |
|
51 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 51 | +error: called `is_some()` after calling `find()` on a string |
52 | 52 | --> $DIR/search_is_some_fixable.rs:26:27 |
53 | 53 | | |
54 | 54 | LL | let _ = "hello world".find(&s2[2..]).is_some(); |
55 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2[2..])` |
| 55 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])` |
56 | 56 |
|
57 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 57 | +error: called `is_some()` after calling `find()` on a string |
58 | 58 | --> $DIR/search_is_some_fixable.rs:28:16 |
59 | 59 | | |
60 | 60 | LL | let _ = s1.find("world").is_some(); |
61 | | - | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains("world")` |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")` |
62 | 62 |
|
63 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 63 | +error: called `is_some()` after calling `find()` on a string |
64 | 64 | --> $DIR/search_is_some_fixable.rs:29:16 |
65 | 65 | | |
66 | 66 | LL | let _ = s1.find(&s2).is_some(); |
67 | | - | ^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2)` |
| 67 | + | ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)` |
68 | 68 |
|
69 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 69 | +error: called `is_some()` after calling `find()` on a string |
70 | 70 | --> $DIR/search_is_some_fixable.rs:30:16 |
71 | 71 | | |
72 | 72 | LL | let _ = s1.find(&s2[2..]).is_some(); |
73 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2[2..])` |
| 73 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])` |
74 | 74 |
|
75 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 75 | +error: called `is_some()` after calling `find()` on a string |
76 | 76 | --> $DIR/search_is_some_fixable.rs:32:21 |
77 | 77 | | |
78 | 78 | LL | let _ = s1[2..].find("world").is_some(); |
79 | | - | ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains("world")` |
| 79 | + | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")` |
80 | 80 |
|
81 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 81 | +error: called `is_some()` after calling `find()` on a string |
82 | 82 | --> $DIR/search_is_some_fixable.rs:33:21 |
83 | 83 | | |
84 | 84 | LL | let _ = s1[2..].find(&s2).is_some(); |
85 | | - | ^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2)` |
| 85 | + | ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)` |
86 | 86 |
|
87 | | -error: called `is_some()` after calling `find()` on a string. This is more succinctly expressed by calling `contains()`. |
| 87 | +error: called `is_some()` after calling `find()` on a string |
88 | 88 | --> $DIR/search_is_some_fixable.rs:34:21 |
89 | 89 | | |
90 | 90 | LL | let _ = s1[2..].find(&s2[2..]).is_some(); |
91 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `contains(&s2[2..])` |
| 91 | + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])` |
92 | 92 |
|
93 | 93 | error: aborting due to 15 previous errors |
94 | 94 |
|
0 commit comments