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