use .contains() or .any() instead of find(x).is_some() (clippy::search_is_some)
This commit is contained in:
parent
dbe3acfaeb
commit
0fa461558c
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user