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/src/semantics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir') diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs index 1198e3f0b..3ff135f41 100644 --- a/crates/hir/src/semantics.rs +++ b/crates/hir/src/semantics.rs @@ -445,7 +445,7 @@ impl<'db> SemanticsImpl<'db> { } }; gpl.lifetime_params() - .find(|tp| tp.lifetime().as_ref().map(|lt| lt.text()) == Some(text)) + .find(|tp| tp.lifetime().as_ref().map(|lt| lt.text()).as_ref() == Some(&text)) })?; let src = self.find_file(lifetime_param.syntax().clone()).with_value(lifetime_param); ToDef::to_def(self, src) -- cgit v1.2.3