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 {

View File

@ -391,7 +391,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for LinkReplacer<'a, I> {
_,
))) => {
debug!("saw end of shortcut link to {}", dest);
if self.links.iter().find(|&link| *link.href == **dest).is_some() {
if self.links.iter().any(|link| *link.href == **dest) {
assert!(self.shortcut_link.is_some(), "saw closing link without opening tag");
self.shortcut_link = None;
}