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
|
||||
// `as_mut`?
|
||||
.find(|a| a.check_name(sym::rustc_conversion_suggestion))
|
||||
.is_some()
|
||||
.any(|a| a.check_name(sym::rustc_conversion_suggestion))
|
||||
});
|
||||
|
||||
methods
|
||||
|
@ -23,14 +23,11 @@ impl InherentOverlapChecker<'tcx> {
|
||||
let impl_items2 = self.tcx.associated_items(impl2);
|
||||
|
||||
for item1 in impl_items1.in_definition_order() {
|
||||
let collision = impl_items2
|
||||
.filter_by_name_unhygienic(item1.ident.name)
|
||||
.find(|item2| {
|
||||
// Symbols and namespace match, compare hygienically.
|
||||
item1.kind.namespace() == item2.kind.namespace()
|
||||
&& item1.ident.modern() == item2.ident.modern()
|
||||
})
|
||||
.is_some();
|
||||
let collision = impl_items2.filter_by_name_unhygienic(item1.ident.name).any(|item2| {
|
||||
// Symbols and namespace match, compare hygienically.
|
||||
item1.kind.namespace() == item2.kind.namespace()
|
||||
&& item1.ident.modern() == item2.ident.modern()
|
||||
});
|
||||
|
||||
if collision {
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user