aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/introduce_variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/introduce_variable.rs')
-rw-r--r--crates/ra_assists/src/introduce_variable.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_assists/src/introduce_variable.rs b/crates/ra_assists/src/introduce_variable.rs
index 5eb708310..95c18d0e3 100644
--- a/crates/ra_assists/src/introduce_variable.rs
+++ b/crates/ra_assists/src/introduce_variable.rs
@@ -56,10 +56,7 @@ pub(crate) fn introduce_variable(mut ctx: AssistCtx<impl HirDatabase>) -> Option
56 // but we do not want to duplicate possible 56 // but we do not want to duplicate possible
57 // extra newlines in the indent block 57 // extra newlines in the indent block
58 let text = indent.text(); 58 let text = indent.text();
59 if text.starts_with("\r\n") { 59 if text.starts_with('\n') {
60 buf.push_str("\r\n");
61 buf.push_str(text.trim_start_matches("\r\n"));
62 } else if text.starts_with('\n') {
63 buf.push_str("\n"); 60 buf.push_str("\n");
64 buf.push_str(text.trim_start_matches('\n')); 61 buf.push_str(text.trim_start_matches('\n'));
65 } else { 62 } else {