diff options
author | Andrea Pretto <[email protected]> | 2019-02-19 21:32:00 +0000 |
---|---|---|
committer | Andrea Pretto <[email protected]> | 2019-04-21 23:13:00 +0100 |
commit | 766813898f7901736d82bfc103874474177e7aca (patch) | |
tree | 4923c73160ab0c53c0d777af965cea99ffaaec9d /crates/ra_hir/src | |
parent | 0e0ae47b47f80e30fca366e5922c19ff81b0a2e2 (diff) |
auto_import: make auto import working with target as a list of SmolStr instead of ast::Path
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/name.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs index 283f37845..331da6027 100644 --- a/crates/ra_hir/src/name.rs +++ b/crates/ra_hir/src/name.rs | |||
@@ -46,6 +46,10 @@ impl Name { | |||
46 | Name::new(idx.to_string().into()) | 46 | Name::new(idx.to_string().into()) |
47 | } | 47 | } |
48 | 48 | ||
49 | pub fn to_smolstr(&self) -> SmolStr { | ||
50 | self.text.clone() | ||
51 | } | ||
52 | |||
49 | pub(crate) fn as_known_name(&self) -> Option<KnownName> { | 53 | pub(crate) fn as_known_name(&self) -> Option<KnownName> { |
50 | let name = match self.text.as_str() { | 54 | let name = match self.text.as_str() { |
51 | "isize" => KnownName::Isize, | 55 | "isize" => KnownName::Isize, |