diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-01-12 22:48:09 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-01-12 22:48:30 +0100 |
| commit | 68aceeed03014fab17269b0f0cb5e79b5097e557 (patch) | |
| tree | aa9c17c415c3d1d69617f6aeca73eef6fa91d14a | |
| parent | 7eca5afd34cb3ed089816456e534712a20b447ee (diff) | |
| download | rust-68aceeed03014fab17269b0f0cb5e79b5097e557.tar.gz rust-68aceeed03014fab17269b0f0cb5e79b5097e557.zip | |
Improve help message for `search_is_some` lint
| -rw-r--r-- | clippy_lints/src/methods/search_is_some.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/methods/search_is_some.rs b/clippy_lints/src/methods/search_is_some.rs index 6339011c92f..ef1baa6c988 100644 --- a/clippy_lints/src/methods/search_is_some.rs +++ b/clippy_lints/src/methods/search_is_some.rs @@ -63,7 +63,7 @@ pub(super) fn check<'tcx>( SEARCH_IS_SOME, method_span.with_hi(expr.span.hi()), &msg, - "use `any()` instead", + "consider using", format!( "any({})", any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str) @@ -77,7 +77,7 @@ pub(super) fn check<'tcx>( SEARCH_IS_SOME, expr.span, &msg, - "use `!_.any()` instead", + "consider using", format!( "!{iter}.any({})", any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str) @@ -118,7 +118,7 @@ pub(super) fn check<'tcx>( SEARCH_IS_SOME, method_span.with_hi(expr.span.hi()), &msg, - "use `contains()` instead", + "consider using", format!("contains({find_arg})"), applicability, ); @@ -132,7 +132,7 @@ pub(super) fn check<'tcx>( SEARCH_IS_SOME, expr.span, &msg, - "use `!_.contains()` instead", + "consider using", format!("!{string}.contains({find_arg})"), applicability, ); |
