diff options
author | Laurențiu Nicola <[email protected]> | 2020-12-29 12:35:49 +0000 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2020-12-29 12:35:49 +0000 |
commit | 42c24ff25f391a1e3662ce226d510aedc9d1f0e4 (patch) | |
tree | 004195234e0409ddc54514a2e8b737ed8e16b74e /crates/assists/src/handlers/extract_variable.rs | |
parent | ef1177c5b5a7ced9866025a51c10e4375e2a37fd (diff) |
Avoid a couple of allocations
Diffstat (limited to 'crates/assists/src/handlers/extract_variable.rs')
-rw-r--r-- | crates/assists/src/handlers/extract_variable.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
91 | // extra newlines in the indent block | 91 | // extra newlines in the indent block |
92 | let text = indent.text(); | 92 | let text = indent.text(); |
93 | if text.starts_with('\n') { | 93 | if text.starts_with('\n') { |
94 | buf.push_str("\n"); | 94 | buf.push('\n'); |
95 | buf.push_str(text.trim_start_matches('\n')); | 95 | buf.push_str(text.trim_start_matches('\n')); |
96 | } else { | 96 | } else { |
97 | buf.push_str(text); | 97 | buf.push_str(text); |