From 816190c6f6838f163acc4bbe6a06c302c99535b2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 31 Dec 2020 10:13:14 +0100 Subject: Remove some unneeded string allocations --- crates/hir_def/src/nameres.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 9bf358775..5682e122d 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs @@ -454,7 +454,7 @@ mod diagnostics { }); for token in tokens { if token.kind() == SyntaxKind::IDENT - && token.to_string() == *name + && token.text() == name.as_str() { precise_location = Some(token.text_range()); break 'outer; -- cgit v1.2.3