]> git.lizzy.rs Git - rust.git/commitdiff
Update `is_hir_id_module`
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Fri, 7 Feb 2020 18:09:19 +0000 (19:09 +0100)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 14 Mar 2020 21:52:29 +0000 (22:52 +0100)
src/librustc/hir/map/mod.rs

index c98a919d0f5f33dfe4478df52cc52379fbc2cef5..9d88e78afa785da7632d7c08c42eb157a741f1fc 100644 (file)
@@ -667,9 +667,9 @@ pub fn is_const_context(&self, hir_id: HirId) -> bool {
 
     /// Whether `hir_id` corresponds to a `mod` or a crate.
     pub fn is_hir_id_module(&self, hir_id: HirId) -> bool {
-        match self.lookup(hir_id) {
-            Some(Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. })
-            | Some(Entry { node: Node::Crate(..), .. }) => true,
+        match self.get_entry(hir_id) {
+            Entry { node: Node::Item(Item { kind: ItemKind::Mod(_), .. }), .. }
+            | Entry { node: Node::Crate(..), .. } => true,
             _ => false,
         }
     }