From 4753409f86bf21b8d0ba7bd83918aa951921c97c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Aug 2019 19:05:44 +0300 Subject: refactor TryConvWith similar to ConvWith --- crates/ra_assists/src/introduce_variable.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/ra_assists/src') 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) -> Option // but we do not want to duplicate possible // extra newlines in the indent block let text = indent.text(); - if text.starts_with("\r\n") { - buf.push_str("\r\n"); - buf.push_str(text.trim_start_matches("\r\n")); - } else if text.starts_with('\n') { + if text.starts_with('\n') { buf.push_str("\n"); buf.push_str(text.trim_start_matches('\n')); } else { -- cgit v1.2.3