From 725c20e8c51aa84a52bbfa96dca7bd999681b541 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Mon, 18 Jan 2021 16:54:07 +0000 Subject: use `is_ident` method --- crates/hir_def/src/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs index e2bf85bbc..61b64f70e 100644 --- a/crates/hir_def/src/path.rs +++ b/crates/hir_def/src/path.rs @@ -87,8 +87,8 @@ 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 { - return None; + if !self.is_ident() { + return None } self.segments.first() } -- cgit v1.2.3