diff options
author | Aleksey Kladov <[email protected]> | 2019-08-20 17:05:44 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-08-20 17:53:05 +0100 |
commit | 4753409f86bf21b8d0ba7bd83918aa951921c97c (patch) | |
tree | 2932f72edeb02e053828447c408d940cdf1d0d3a /crates/ra_assists/src/introduce_variable.rs | |
parent | 6ea4184fd107e5cc155b95a3cf058200c38d544d (diff) |
refactor TryConvWith similar to ConvWith
Diffstat (limited to 'crates/ra_assists/src/introduce_variable.rs')
-rw-r--r-- | crates/ra_assists/src/introduce_variable.rs | 5 |
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 { |