From d27ed8c2431e5d7e1ecf48366259d6b3b657d9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 6 Sep 2021 17:55:07 +0300 Subject: [PATCH] Avoid extra allocation in completion rendering --- crates/ide_completion/src/render.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index 91f565a5f8..62a5fac534 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs @@ -101,7 +101,7 @@ pub(crate) fn render_field( .lookup_by(name.as_str()); let is_keyword = SyntaxKind::from_keyword(name.as_str()).is_some(); if is_keyword && !matches!(name.as_str(), "self" | "crate" | "super" | "Self") { - item.insert_text(String::from("r#") + name.as_str()); + item.insert_text(format!("r#{}", name)); } if let Some(_ref_match) = compute_ref_match(ctx.completion, ty) { // FIXME