aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-20 17:05:44 +0100
committerAleksey Kladov <[email protected]>2019-08-20 17:53:05 +0100
commit4753409f86bf21b8d0ba7bd83918aa951921c97c (patch)
tree2932f72edeb02e053828447c408d940cdf1d0d3a /crates/ra_assists/src
parent6ea4184fd107e5cc155b95a3cf058200c38d544d (diff)
refactor TryConvWith similar to ConvWith
Diffstat (limited to 'crates/ra_assists/src')
-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 {