mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Improve help message for search_is_some
lint
This commit is contained in:
parent
7eca5afd34
commit
68aceeed03
1 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,7 @@ pub(super) fn check<'tcx>(
|
||||||
SEARCH_IS_SOME,
|
SEARCH_IS_SOME,
|
||||||
method_span.with_hi(expr.span.hi()),
|
method_span.with_hi(expr.span.hi()),
|
||||||
&msg,
|
&msg,
|
||||||
"use `any()` instead",
|
"consider using",
|
||||||
format!(
|
format!(
|
||||||
"any({})",
|
"any({})",
|
||||||
any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str)
|
any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str)
|
||||||
|
@ -77,7 +77,7 @@ pub(super) fn check<'tcx>(
|
||||||
SEARCH_IS_SOME,
|
SEARCH_IS_SOME,
|
||||||
expr.span,
|
expr.span,
|
||||||
&msg,
|
&msg,
|
||||||
"use `!_.any()` instead",
|
"consider using",
|
||||||
format!(
|
format!(
|
||||||
"!{iter}.any({})",
|
"!{iter}.any({})",
|
||||||
any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str)
|
any_search_snippet.as_ref().map_or(&*search_snippet, String::as_str)
|
||||||
|
@ -118,7 +118,7 @@ pub(super) fn check<'tcx>(
|
||||||
SEARCH_IS_SOME,
|
SEARCH_IS_SOME,
|
||||||
method_span.with_hi(expr.span.hi()),
|
method_span.with_hi(expr.span.hi()),
|
||||||
&msg,
|
&msg,
|
||||||
"use `contains()` instead",
|
"consider using",
|
||||||
format!("contains({find_arg})"),
|
format!("contains({find_arg})"),
|
||||||
applicability,
|
applicability,
|
||||||
);
|
);
|
||||||
|
@ -132,7 +132,7 @@ pub(super) fn check<'tcx>(
|
||||||
SEARCH_IS_SOME,
|
SEARCH_IS_SOME,
|
||||||
expr.span,
|
expr.span,
|
||||||
&msg,
|
&msg,
|
||||||
"use `!_.contains()` instead",
|
"consider using",
|
||||||
format!("!{string}.contains({find_arg})"),
|
format!("!{string}.contains({find_arg})"),
|
||||||
applicability,
|
applicability,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue