rust-clippy/tests/ui/search_is_some_fixable_some.stderr

209 lines
10 KiB
Text
Raw Normal View History

2021-08-19 08:38:40 +00:00
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:10:22
|
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x < 0)`
|
= note: `-D clippy::search-is-some` implied by `-D warnings`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:11:20
|
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| **y == x)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:12:20
|
LL | let _ = (0..1).find(|x| *x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:13:22
|
LL | let _ = v.iter().find(|x| **x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| *x == 0)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:14:20
|
LL | let _ = (4..5).find(|x| *x == 1 || *x == 3 || *x == 5).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 1 || x == 3 || x == 5)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:15:20
|
LL | let _ = (1..3).find(|x| [1, 2, 3].contains(x)).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| [1, 2, 3].contains(&x))`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:16:20
|
LL | let _ = (1..3).find(|x| *x == 0 || [1, 2, 3].contains(x)).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| x == 0 || [1, 2, 3].contains(&x))`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:17:20
|
LL | let _ = (1..3).find(|x| [1, 2, 3].contains(x) || *x == 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| [1, 2, 3].contains(&x) || x == 0)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:19:10
|
LL | .find(|x| [1, 2, 3].contains(x) || *x == 0 || [4, 5, 6].contains(x) || *x == -1)
| __________^
LL | | .is_some();
| |__________________^ help: use `any()` instead: `any(|x| [1, 2, 3].contains(&x) || x == 0 || [4, 5, 6].contains(&x) || x == -1)`
error: called `is_some()` after searching an `Iterator` with `position`
--> $DIR/search_is_some_fixable_some.rs:23:22
|
LL | let _ = v.iter().position(|&x| x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)`
error: called `is_some()` after searching an `Iterator` with `rposition`
--> $DIR/search_is_some_fixable_some.rs:26:22
|
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|&x| x < 0)`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:31:27
|
LL | let _ = "hello world".find("world").is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:32:27
|
LL | let _ = "hello world".find(&s2).is_some();
| ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:33:27
|
LL | let _ = "hello world".find(&s2[2..]).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:35:16
|
LL | let _ = s1.find("world").is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:36:16
|
LL | let _ = s1.find(&s2).is_some();
| ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:37:16
|
LL | let _ = s1.find(&s2[2..]).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:39:21
|
LL | let _ = s1[2..].find("world").is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains("world")`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:40:21
|
LL | let _ = s1[2..].find(&s2).is_some();
| ^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2)`
error: called `is_some()` after calling `find()` on a string
--> $DIR/search_is_some_fixable_some.rs:41:21
|
LL | let _ = s1[2..].find(&s2[2..]).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `contains()` instead: `contains(&s2[2..])`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:57:44
|
LL | .filter(|c| filter_hand.iter().find(|cc| c == cc).is_some())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|cc| c == &cc)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:73:49
|
LL | .filter(|(c, _)| filter_hand.iter().find(|cc| c == *cc).is_some())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|cc| c == cc)`
2021-09-12 09:31:11 +00:00
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:84:29
|
LL | let _ = vfoo.iter().find(|v| v.foo == 1 && v.bar == 2).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|v| v.foo == 1 && v.bar == 2)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:89:14
|
LL | .find(|(i, v)| *i == 42 && v.foo == 1 && v.bar == 2)
| ______________^
LL | | .is_some();
| |______________________^ help: use `any()` instead: `any(|(i, v)| *i == 42 && v.foo == 1 && v.bar == 2)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:95:29
|
LL | let _ = vfoo.iter().find(|a| a[0] == 42).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|a| a[0] == 42)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:101:29
|
LL | let _ = vfoo.iter().find(|sub| sub[1..4].len() == 3).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|sub| sub[1..4].len() == 3)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:119:30
|
LL | let _ = [ppx].iter().find(|ppp_x: &&&u32| please(**ppp_x)).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|ppp_x: &&u32| please(ppp_x))`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:120:50
|
LL | let _ = [String::from("Hey hey")].iter().find(|s| s.len() == 2).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|s| s.len() == 2)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:123:26
|
LL | let _ = v.iter().find(|x| deref_enough(**x)).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| deref_enough(*x))`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:126:26
|
LL | let _ = v.iter().find(|x| arg_no_deref(x)).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| arg_no_deref(&x))`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:148:14
|
LL | .find(|v| v.inner_double.bar[0][0] == 2 && v.inner.bar[0] == 2)
| ______________^
LL | | .is_some();
| |______________________^ help: use `any()` instead: `any(|v| v.inner_double.bar[0][0] == 2 && v.inner.bar[0] == 2)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:162:29
|
LL | let _ = vfoo.iter().find(|v| v.inner[0].bar == 2).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|v| v.inner[0].bar == 2)`
error: called `is_some()` after searching an `Iterator` with `find`
--> $DIR/search_is_some_fixable_some.rs:167:29
|
LL | let _ = vfoo.iter().find(|x| (**x)[0] == 9).is_some();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(|x| (**x)[0] == 9)`
error: aborting due to 33 previous errors
2021-08-19 08:38:40 +00:00