From 5ff3299dd61ea5c5790c01819994c9d8fa6afc09 Mon Sep 17 00:00:00 2001 From: cynecx Date: Fri, 26 Mar 2021 18:30:59 +0100 Subject: syntax: return owned string instead of leaking string --- crates/hir_expand/src/name.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_expand') 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 { fn as_name(&self) -> Name { match self.as_tuple_field() { Some(idx) => Name::new_tuple_field(idx), - None => Name::resolve(self.text()), + None => Name::resolve(&self.text()), } } } impl AsName for ast::Name { fn as_name(&self) -> Name { - Name::resolve(self.text()) + Name::resolve(&self.text()) } } -- cgit v1.2.3