aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/name.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/name.rs')
-rw-r--r--crates/ra_hir/src/name.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs
index 677d18efc..283f37845 100644
--- a/crates/ra_hir/src/name.rs
+++ b/crates/ra_hir/src/name.rs
@@ -90,6 +90,15 @@ impl AsName for ast::Name {
90 } 90 }
91} 91}
92 92
93impl<'a> AsName for ast::FieldKind<'a> {
94 fn as_name(&self) -> Name {
95 match self {
96 ast::FieldKind::Name(nr) => nr.as_name(),
97 ast::FieldKind::Index(idx) => Name::new(idx.text().clone()),
98 }
99 }
100}
101
93impl AsName for ra_db::Dependency { 102impl AsName for ra_db::Dependency {
94 fn as_name(&self) -> Name { 103 fn as_name(&self) -> Name {
95 Name::new(self.name.clone()) 104 Name::new(self.name.clone())