Skip to content

Commit 0fa4615

Browse files
committed
use .contains() or .any() instead of find(x).is_some() (clippy::search_is_some)
1 parent dbe3acf commit 0fa4615

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_mir/src/borrow_check/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
445445
"highlight_if_we_cannot_match_hir_ty: type_name={:?} needle_fr={:?}",
446446
type_name, needle_fr
447447
);
448-
if type_name.find(&format!("'{}", counter)).is_some() {
448+
if type_name.contains(&format!("'{}", counter)) {
449449
// Only add a label if we can confirm that a region was labelled.
450450
RegionNameHighlight::CannotMatchHirTy(span, type_name)
451451
} else {

src/librustdoc/html/markdown.rs

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

0 commit comments

Comments
 (0)