Use .any(x) instead of .find(x).is_some() on iterators.
This commit is contained in:
parent
c287d86d2c
commit
ae34b9d996
@ -236,8 +236,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
//
|
//
|
||||||
// FIXME? Other potential candidate methods: `as_ref` and
|
// FIXME? Other potential candidate methods: `as_ref` and
|
||||||
// `as_mut`?
|
// `as_mut`?
|
||||||
.find(|a| a.check_name(sym::rustc_conversion_suggestion))
|
.any(|a| a.check_name(sym::rustc_conversion_suggestion))
|
||||||
.is_some()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
methods
|
methods
|
||||||
|
@ -23,14 +23,11 @@ impl InherentOverlapChecker<'tcx> {
|
|||||||
let impl_items2 = self.tcx.associated_items(impl2);
|
let impl_items2 = self.tcx.associated_items(impl2);
|
||||||
|
|
||||||
for item1 in impl_items1.in_definition_order() {
|
for item1 in impl_items1.in_definition_order() {
|
||||||
let collision = impl_items2
|
let collision = impl_items2.filter_by_name_unhygienic(item1.ident.name).any(|item2| {
|
||||||
.filter_by_name_unhygienic(item1.ident.name)
|
// Symbols and namespace match, compare hygienically.
|
||||||
.find(|item2| {
|
item1.kind.namespace() == item2.kind.namespace()
|
||||||
// Symbols and namespace match, compare hygienically.
|
&& item1.ident.modern() == item2.ident.modern()
|
||||||
item1.kind.namespace() == item2.kind.namespace()
|
});
|
||||||
&& item1.ident.modern() == item2.ident.modern()
|
|
||||||
})
|
|
||||||
.is_some();
|
|
||||||
|
|
||||||
if collision {
|
if collision {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user