Update is_hir_id_module
This commit is contained in:
parent
9c4308ed92
commit
21942a5cf6
1 changed files with 3 additions and 3 deletions
|
|
@ -667,9 +667,9 @@ impl<'hir> Map<'hir> {
|
|||
|
||||
/// 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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue