From 42c24ff25f391a1e3662ce226d510aedc9d1f0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 29 Dec 2020 14:35:49 +0200 Subject: Avoid a couple of allocations --- crates/assists/src/handlers/extract_variable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/assists/src/handlers/extract_variable.rs') diff --git a/crates/assists/src/handlers/extract_variable.rs b/crates/assists/src/handlers/extract_variable.rs index d2ae137cd..9957012fe 100644 --- a/crates/assists/src/handlers/extract_variable.rs +++ b/crates/assists/src/handlers/extract_variable.rs @@ -91,7 +91,7 @@ pub(crate) fn extract_variable(acc: &mut Assists, ctx: &AssistContext) -> Option // extra newlines in the indent block let text = indent.text(); if text.starts_with('\n') { - buf.push_str("\n"); + buf.push('\n'); buf.push_str(text.trim_start_matches('\n')); } else { buf.push_str(text); -- cgit v1.2.3