Tweak a resolutions
loop.
In this case field access is more concise and easier to read than destructuring, and it matches how other similar loops are done elsewhere.
This commit is contained in:
parent
93f2258565
commit
d1d8be1d13
1 changed files with 5 additions and 6 deletions
|
@ -1809,12 +1809,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
assoc_item: Option<(Symbol, Namespace)>,
|
||||
) -> bool {
|
||||
match (trait_module, assoc_item) {
|
||||
(Some(trait_module), Some((name, ns))) => {
|
||||
self.resolutions(trait_module).borrow().iter().any(|resolution| {
|
||||
let (&BindingKey { ident: assoc_ident, ns: assoc_ns, .. }, _) = resolution;
|
||||
assoc_ns == ns && assoc_ident.name == name
|
||||
})
|
||||
}
|
||||
(Some(trait_module), Some((name, ns))) => self
|
||||
.resolutions(trait_module)
|
||||
.borrow()
|
||||
.iter()
|
||||
.any(|(key, _name_resolution)| key.ns == ns && key.ident.name == name),
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue