Delete useless loop
This commit is contained in:
parent
1c75724752
commit
5a90de8f5e
1 changed files with 8 additions and 9 deletions
|
@ -74,7 +74,7 @@ impl<'hir> Iterator for ParentHirIterator<'hir> {
|
||||||
if self.current_id == CRATE_HIR_ID {
|
if self.current_id == CRATE_HIR_ID {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
loop {
|
|
||||||
// There are nodes that do not have entries, so we need to skip them.
|
// There are nodes that do not have entries, so we need to skip them.
|
||||||
let parent_id = self.map.parent_id(self.current_id);
|
let parent_id = self.map.parent_id(self.current_id);
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ impl<'hir> Iterator for ParentHirIterator<'hir> {
|
||||||
return Some(parent_id);
|
return Some(parent_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// An iterator that walks up the ancestor tree of a given `HirId`.
|
/// An iterator that walks up the ancestor tree of a given `HirId`.
|
||||||
/// Constructed using `tcx.hir().parent_owner_iter(hir_id)`.
|
/// Constructed using `tcx.hir().parent_owner_iter(hir_id)`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue