mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
87 lines
3 KiB
Text
87 lines
3 KiB
Text
error: called `is_some()` after searching an `Iterator` with `find`
|
|
--> $DIR/search_is_some.rs:15:13
|
|
|
|
|
LL | let _ = v.iter().find(|&x| {
|
|
| _____________^
|
|
LL | | *x < 0
|
|
LL | | }
|
|
LL | | ).is_some();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()`
|
|
= note: `-D clippy::search-is-some` implied by `-D warnings`
|
|
|
|
error: called `is_some()` after searching an `Iterator` with `position`
|
|
--> $DIR/search_is_some.rs:21:13
|
|
|
|
|
LL | let _ = v.iter().position(|&x| {
|
|
| _____________^
|
|
LL | | x < 0
|
|
LL | | }
|
|
LL | | ).is_some();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()`
|
|
|
|
error: called `is_some()` after searching an `Iterator` with `rposition`
|
|
--> $DIR/search_is_some.rs:27:13
|
|
|
|
|
LL | let _ = v.iter().rposition(|&x| {
|
|
| _____________^
|
|
LL | | x < 0
|
|
LL | | }
|
|
LL | | ).is_some();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()`
|
|
|
|
error: called `is_some()` after searching an `Iterator` with `find`
|
|
--> $DIR/search_is_some.rs:42:20
|
|
|
|
|
LL | let _ = (0..1).find(some_closure).is_some();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead: `any(some_closure)`
|
|
|
|
error: called `is_none()` after searching an `Iterator` with `find`
|
|
--> $DIR/search_is_some.rs:52:13
|
|
|
|
|
LL | let _ = v.iter().find(|&x| {
|
|
| _____________^
|
|
LL | | *x < 0
|
|
LL | | }
|
|
LL | | ).is_none();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()` with negation
|
|
|
|
error: called `is_none()` after searching an `Iterator` with `position`
|
|
--> $DIR/search_is_some.rs:58:13
|
|
|
|
|
LL | let _ = v.iter().position(|&x| {
|
|
| _____________^
|
|
LL | | x < 0
|
|
LL | | }
|
|
LL | | ).is_none();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()` with negation
|
|
|
|
error: called `is_none()` after searching an `Iterator` with `rposition`
|
|
--> $DIR/search_is_some.rs:64:13
|
|
|
|
|
LL | let _ = v.iter().rposition(|&x| {
|
|
| _____________^
|
|
LL | | x < 0
|
|
LL | | }
|
|
LL | | ).is_none();
|
|
| |______________________________^
|
|
|
|
|
= help: this is more succinctly expressed by calling `any()` with negation
|
|
|
|
error: called `is_none()` after searching an `Iterator` with `find`
|
|
--> $DIR/search_is_some.rs:79:13
|
|
|
|
|
LL | let _ = (0..1).find(some_closure).is_none();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead: `!(0..1).any(some_closure)`
|
|
|
|
error: aborting due to 8 previous errors
|
|
|