File tree Expand file tree Collapse file tree 5 files changed +97
-97
lines changed Expand file tree Collapse file tree 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>(
6363 SEARCH_IS_SOME ,
6464 method_span. with_hi ( expr. span . hi ( ) ) ,
6565 & msg,
66- "use `any()` instead " ,
66+ "consider using " ,
6767 format ! (
6868 "any({})" ,
6969 any_search_snippet. as_ref( ) . map_or( & * search_snippet, String :: as_str)
@@ -77,7 +77,7 @@ pub(super) fn check<'tcx>(
7777 SEARCH_IS_SOME ,
7878 expr. span ,
7979 & msg,
80- "use `!_.any()` instead " ,
80+ "consider using " ,
8181 format ! (
8282 "!{iter}.any({})" ,
8383 any_search_snippet. as_ref( ) . map_or( & * search_snippet, String :: as_str)
@@ -118,7 +118,7 @@ pub(super) fn check<'tcx>(
118118 SEARCH_IS_SOME ,
119119 method_span. with_hi ( expr. span . hi ( ) ) ,
120120 & msg,
121- "use `contains()` instead " ,
121+ "consider using " ,
122122 format ! ( "contains({find_arg})" ) ,
123123 applicability,
124124 ) ;
@@ -132,7 +132,7 @@ pub(super) fn check<'tcx>(
132132 SEARCH_IS_SOME ,
133133 expr. span ,
134134 & msg,
135- "use `!_.contains()` instead " ,
135+ "consider using " ,
136136 format ! ( "!{string}.contains({find_arg})" ) ,
137137 applicability,
138138 ) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: called `is_some()` after searching an `Iterator` with `find`
22 --> $DIR/ice-9041.rs:5:19
33 |
44LL | 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))`
66 |
77 = note: `-D clippy::search-is-some` implied by `-D warnings`
88 = 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`
4040 --> $DIR/search_is_some.rs:42:20
4141 |
4242LL | let _ = (0..1).find(some_closure).is_some();
43- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `any()` instead : `any(some_closure)`
43+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using : `any(some_closure)`
4444
4545error: called `is_none()` after searching an `Iterator` with `find`
4646 --> $DIR/search_is_some.rs:52:13
@@ -82,7 +82,7 @@ error: called `is_none()` after searching an `Iterator` with `find`
8282 --> $DIR/search_is_some.rs:79:13
8383 |
8484LL | 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)`
8686
8787error: aborting due to 8 previous errors
8888
You can’t perform that action at this time.
0 commit comments