Skip to content

Commit 725c20e

Browse files
committed
use is_ident method
1 parent 171c3c0 commit 725c20e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/hir_def/src/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ impl ModPath {
8787

8888
/// If this path is a single identifier, like `foo`, return its name.
8989
pub fn as_ident(&self) -> Option<&Name> {
90-
if self.kind != PathKind::Plain || self.segments.len() > 1 {
91-
return None;
90+
if !self.is_ident() {
91+
return None
9292
}
9393
self.segments.first()
9494
}

0 commit comments

Comments
 (0)