From 4bcf8c8c68bd791f295aa06ef7903c006be3f356 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 9 Jun 2020 17:32:42 +0200 Subject: Add an FST index to `ImportMap` --- crates/ra_hir_expand/src/name.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_hir_expand') 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 { _ => None, } } + + pub fn as_text(&self) -> Option<&str> { + match &self.0 { + Repr::Text(s) => Some(s.as_str()), + _ => None, + } + } } pub trait AsName { -- cgit v1.2.3