We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
find
1 parent a9ec0fa commit 02b6df7Copy full SHA for 02b6df7
src/librustc/hir/map/mod.rs
@@ -612,13 +612,8 @@ impl<'hir> Map<'hir> {
612
613
/// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found.
614
pub fn find(&self, hir_id: HirId) -> Option<Node<'hir>> {
615
- let result = self.find_entry(hir_id).and_then(|entry| {
616
- if let Node::Crate(..) = entry.node { None } else { Some(entry.node) }
617
- });
618
- if result.is_some() {
619
- self.read(hir_id);
620
- }
621
- result
+ let node = self.get_entry(hir_id).node;
+ if let Node::Crate(..) = node { None } else { Some(node) }
622
}
623
624
/// Similar to `get_parent`; returns the parent HIR Id, or just `hir_id` if there
0 commit comments