diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs index 3dd7c3cbba..e34cd7f2f2 100644 --- a/crates/hir_def/src/path.rs +++ b/crates/hir_def/src/path.rs @@ -87,7 +87,7 @@ impl ModPath { /// If this path is a single identifier, like `foo`, return its name. pub fn as_ident(&self) -> Option<&Name> { - if self.kind != PathKind::Plain || self.segments.len() > 1 { + if !self.is_ident() { return None; } self.segments.first()