aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-18 17:40:11 +0000
committerGitHub <[email protected]>2021-01-18 17:40:11 +0000
commitfcc109e8904a1b965cbb860daf4e626a78ec125f (patch)
treedbd947227c65a73bd80fc2f749896cc87e7d40fb
parent9210f480ac1788aaac18a0a575ee3556e0e5f9e3 (diff)
parentda104bb0f57b061547860184cb81c507f50f9f8e (diff)
Merge #7326
7326: Use `is_ident` when converting Path to an Identifier r=edwin0cheng a=kevaundray Co-authored-by: Kevaundray Wedderburn <[email protected]>
-rw-r--r--crates/hir_def/src/path.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs
index 3dd7c3cbb..e34cd7f2f 100644
--- a/crates/hir_def/src/path.rs
+++ b/crates/hir_def/src/path.rs
@@ -87,7 +87,7 @@ impl ModPath {
87 87
88 /// If this path is a single identifier, like `foo`, return its name. 88 /// If this path is a single identifier, like `foo`, return its name.
89 pub fn as_ident(&self) -> Option<&Name> { 89 pub fn as_ident(&self) -> Option<&Name> {
90 if self.kind != PathKind::Plain || self.segments.len() > 1 { 90 if !self.is_ident() {
91 return None; 91 return None;
92 } 92 }
93 self.segments.first() 93 self.segments.first()