mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 01:52:51 +00:00
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
@ -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…
Reference in New Issue
Block a user