File tree 5 files changed +97
-97
lines changed
5 files changed +97
-97
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ pub(super) fn check<'tcx>(
63
63
SEARCH_IS_SOME ,
64
64
method_span. with_hi ( expr. span . hi ( ) ) ,
65
65
& msg,
66
- "use `any()` instead " ,
66
+ "consider using " ,
67
67
format ! (
68
68
"any({})" ,
69
69
any_search_snippet. as_ref( ) . map_or( & * search_snippet, String :: as_str)
@@ -77,7 +77,7 @@ pub(super) fn check<'tcx>(
77
77
SEARCH_IS_SOME ,
78
78
expr. span ,
79
79
& msg,
80
- "use `!_.any()` instead " ,
80
+ "consider using " ,
81
81
format ! (
82
82
"!{iter}.any({})" ,
83
83
any_search_snippet. as_ref( ) . map_or( & * search_snippet, String :: as_str)
@@ -118,7 +118,7 @@ pub(super) fn check<'tcx>(
118
118
SEARCH_IS_SOME ,
119
119
method_span. with_hi ( expr. span . hi ( ) ) ,
120
120
& msg,
121
- "use `contains()` instead " ,
121
+ "consider using " ,
122
122
format ! ( "contains({find_arg})" ) ,
123
123
applicability,
124
124
) ;
@@ -132,7 +132,7 @@ pub(super) fn check<'tcx>(
132
132
SEARCH_IS_SOME ,
133
133
expr. span ,
134
134
& msg,
135
- "use `!_.contains()` instead " ,
135
+ "consider using " ,
136
136
format ! ( "!{string}.contains({find_arg})" ) ,
137
137
applicability,
138
138
) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: called `is_some()` after searching an `Iterator` with `find`
2
2
--> $DIR/ice-9041.rs:5:19
3
3
|
4
4
LL | things.iter().find(|p| is_thing_ready(p)).is_some()
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead : `any(|p| is_thing_ready(&p))`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using : `any(|p| is_thing_ready(&p))`
6
6
|
7
7
= note: `-D clippy::search-is-some` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::search_is_some)]`
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ error: called `is_some()` after searching an `Iterator` with `find`
40
40
--> $DIR/search_is_some.rs:42:20
41
41
|
42
42
LL | let _ = (0..1).find(some_closure).is_some();
43
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead : `any(some_closure)`
43
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using : `any(some_closure)`
44
44
45
45
error: called `is_none()` after searching an `Iterator` with `find`
46
46
--> $DIR/search_is_some.rs:52:13
@@ -82,7 +82,7 @@ error: called `is_none()` after searching an `Iterator` with `find`
82
82
--> $DIR/search_is_some.rs:79:13
83
83
|
84
84
LL | let _ = (0..1).find(some_closure).is_none();
85
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `!_.any()` instead : `!(0..1).any(some_closure)`
85
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using : `!(0..1).any(some_closure)`
86
86
87
87
error: aborting due to 8 previous errors
88
88
You can’t perform that action at this time.
0 commit comments