1
Fork 0

use .contains() or .any() instead of find(x).is_some() (clippy::search_is_some)

This commit is contained in:
Matthias Krüger 2020-12-05 13:16:34 +01:00
parent dbe3acfaeb
commit 0fa461558c
2 changed files with 2 additions and 2 deletions

View file

@ -445,7 +445,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
"highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
type_name, needle_fr
);
if type_name.find(&format!("'{}", counter)).is_some() {
if type_name.contains(&format!("'{}", counter)) {
// Only add a label if we can confirm that a region was labelled.
RegionNameHighlight::CannotMatchHirTy(span, type_name)
} else {