aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/name.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-26 17:59:06 +0000
committerGitHub <[email protected]>2021-03-26 17:59:06 +0000
commit77a447dcda82a9f0eb6e1f04bd4b1dd53a226c65 (patch)
treee691982730fe01802f874066927b2ebbe8badc75 /crates/hir_expand/src/name.rs
parent4ecaad98e074c42dbf637a11afcb630aafffd7b3 (diff)
parent5ff3299dd61ea5c5790c01819994c9d8fa6afc09 (diff)
Merge #8191
8191: syntax: return owned string instead of leaking string r=cynecx a=cynecx Quick hack? to alleviate https://github.com/rust-analyzer/rust-analyzer/issues/8181#issuecomment-806019126. I haven't run any tests but this should affect performance since we are deallocating more. r? @matklad Co-authored-by: cynecx <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/name.rs')
-rw-r--r--crates/hir_expand/src/name.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index 0aeea48d5..cd691b1d2 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -75,14 +75,14 @@ impl AsName for ast::NameRef {
75 fn as_name(&self) -> Name { 75 fn as_name(&self) -> Name {
76 match self.as_tuple_field() { 76 match self.as_tuple_field() {
77 Some(idx) => Name::new_tuple_field(idx), 77 Some(idx) => Name::new_tuple_field(idx),
78 None => Name::resolve(self.text()), 78 None => Name::resolve(&self.text()),
79 } 79 }
80 } 80 }
81} 81}
82 82
83impl AsName for ast::Name { 83impl AsName for ast::Name {
84 fn as_name(&self) -> Name { 84 fn as_name(&self) -> Name {
85 Name::resolve(self.text()) 85 Name::resolve(&self.text())
86 } 86 }
87} 87}
88 88