aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r--crates/ra_hir_expand/src/name.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs
index 660bdfe33..f306d9641 100644
--- a/crates/ra_hir_expand/src/name.rs
+++ b/crates/ra_hir_expand/src/name.rs
@@ -67,6 +67,13 @@ impl Name {
67 _ => None, 67 _ => None,
68 } 68 }
69 } 69 }
70
71 pub fn as_text(&self) -> Option<&str> {
72 match &self.0 {
73 Repr::Text(s) => Some(s.as_str()),
74 _ => None,
75 }
76 }
70} 77}
71 78
72pub trait AsName { 79pub trait AsName {