aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Andreev <[email protected]>2019-07-03 20:17:43 +0100
committerAlexander Andreev <[email protected]>2019-07-03 20:17:43 +0100
commit6263aa13d0eed983827d14fa39bf6490eb27e7a5 (patch)
treebe97bd1d253de1e419dc431e4d133dfc73854b71
parent02e9e46ed6443f053d2c22335ff57f98d5f64f05 (diff)
Fixed request changes
-rw-r--r--crates/ra_hir/src/name.rs8
-rw-r--r--crates/ra_hir/src/nameres/tests.rs3
2 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir/src/name.rs b/crates/ra_hir/src/name.rs
index 0bb7cae99..06a2dbc76 100644
--- a/crates/ra_hir/src/name.rs
+++ b/crates/ra_hir/src/name.rs
@@ -98,14 +98,14 @@ pub(crate) trait AsName {
98 98
99impl AsName for ast::NameRef { 99impl AsName for ast::NameRef {
100 fn as_name(&self) -> Name { 100 fn as_name(&self) -> Name {
101 let name = resolve_name(self.text().clone()); 101 let name = resolve_name(self.text());
102 Name::new(name) 102 Name::new(name)
103 } 103 }
104} 104}
105 105
106impl AsName for ast::Name { 106impl AsName for ast::Name {
107 fn as_name(&self) -> Name { 107 fn as_name(&self) -> Name {
108 let name = resolve_name(self.text().clone()); 108 let name = resolve_name(self.text());
109 Name::new(name) 109 Name::new(name)
110 } 110 }
111} 111}
@@ -187,11 +187,11 @@ impl AsName for KnownName {
187 } 187 }
188} 188}
189 189
190fn resolve_name(text: SmolStr) -> SmolStr { 190fn resolve_name(text: &SmolStr) -> SmolStr {
191 let raw_start = "r#"; 191 let raw_start = "r#";
192 if text.as_str().starts_with(raw_start) { 192 if text.as_str().starts_with(raw_start) {
193 SmolStr::new(&text[raw_start.len()..]) 193 SmolStr::new(&text[raw_start.len()..])
194 } else { 194 } else {
195 text 195 text.clone()
196 } 196 }
197} 197}
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 78332ce7c..07b533e29 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -340,7 +340,7 @@ fn module_resolution_works_for_non_standard_filenames() {
340 340
341#[test] 341#[test]
342fn module_resolution_works_for_raw_modules() { 342fn module_resolution_works_for_raw_modules() {
343 let map = def_map_with_crate_graph( 343 let map = def_map_with_crate_graph(
344 " 344 "
345 //- /library.rs 345 //- /library.rs
346 mod r#async; 346 mod r#async;
@@ -362,7 +362,6 @@ fn module_resolution_works_for_raw_modules() {
362 ⋮crate::async 362 ⋮crate::async
363 ⋮Bar: t v 363 ⋮Bar: t v
364 "###); 364 "###);
365
366} 365}
367 366
368#[test] 367#[test]