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 d5827d8 commit 9c4308eCopy full SHA for 9c4308e
src/librustc/hir/map/mod.rs
@@ -607,13 +607,8 @@ impl<'hir> Map<'hir> {
607
608
/// Retrieves the `Node` corresponding to `id`, returning `None` if cannot be found.
609
pub fn find(&self, hir_id: HirId) -> Option<Node<'hir>> {
610
- let result = self.find_entry(hir_id).and_then(|entry| {
611
- if let Node::Crate(..) = entry.node { None } else { Some(entry.node) }
612
- });
613
- if result.is_some() {
614
- self.read(hir_id);
615
- }
616
- result
+ let node = self.get_entry(hir_id).node;
+ if let Node::Crate(..) = node { None } else { Some(node) }
617
}
618
619
/// Similar to `get_parent`; returns the parent HIR Id, or just `hir_id` if there
0 commit comments