aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_expand/src')
-rw-r--r--crates/hir_expand/src/name.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index 74cf64aab..c7609e90d 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -87,18 +87,11 @@ impl AsName for ast::Name {
87 } 87 }
88} 88}
89 89
90impl AsName for ast::Lifetime { 90impl AsName for ast::NameOrNameRef {
91 fn as_name(&self) -> Name {
92 Name::resolve(self.text())
93 }
94}
95
96impl AsName for ast::NameLike {
97 fn as_name(&self) -> Name { 91 fn as_name(&self) -> Name {
98 match self { 92 match self {
99 ast::NameLike::Name(it) => it.as_name(), 93 ast::NameOrNameRef::Name(it) => it.as_name(),
100 ast::NameLike::NameRef(it) => it.as_name(), 94 ast::NameOrNameRef::NameRef(it) => it.as_name(),
101 ast::NameLike::Lifetime(it) => it.as_name(),
102 } 95 }
103 } 96 }
104} 97}