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