Address style nits
This commit is contained in:
parent
6aa9145753
commit
ac264196e2
2 changed files with 7 additions and 5 deletions
|
@ -290,12 +290,14 @@ pub trait NodeIdTree {
|
|||
impl<'a> NodeIdTree for ast_map::Map<'a> {
|
||||
fn is_descendant_of(&self, node: NodeId, ancestor: NodeId) -> bool {
|
||||
let mut node_ancestor = node;
|
||||
loop {
|
||||
if node_ancestor == ancestor { return true }
|
||||
while node_ancestor != ancestor {
|
||||
let node_ancestor_parent = self.get_module_parent(node_ancestor);
|
||||
if node_ancestor_parent == node_ancestor { return false }
|
||||
if node_ancestor_parent == node_ancestor {
|
||||
return false;
|
||||
}
|
||||
node_ancestor = node_ancestor_parent;
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1125,14 +1125,14 @@ impl<'a, 'tcx> ty::NodeIdTree for Resolver<'a, 'tcx> {
|
|||
fn is_descendant_of(&self, node: NodeId, ancestor: NodeId) -> bool {
|
||||
let ancestor = self.ast_map.local_def_id(ancestor);
|
||||
let mut module = *self.module_map.get(&node).unwrap();
|
||||
loop {
|
||||
if module.def_id() == Some(ancestor) { return true; }
|
||||
while module.def_id() != Some(ancestor) {
|
||||
let module_parent = match self.get_nearest_normal_module_parent(module) {
|
||||
Some(parent) => parent,
|
||||
None => return false,
|
||||
};
|
||||
module = module_parent;
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue