From a63ae7d0ed8e1572000e7aac0e17a08343b09374 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 9 Jun 2022 18:11:11 -0400 Subject: [PATCH] Fix trim newline preserving --- src/trim.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trim.rs b/src/trim.rs index 4606de4..5e20304 100644 --- a/src/trim.rs +++ b/src/trim.rs @@ -35,9 +35,10 @@ pub fn trim(options: &Options) -> Result { } if !options.no_preserve_newline && s.ends_with('\n') { - s + "\n" + eprintln!("Adding newline: {s:?}"); + new_string.to_owned() + "\n" } else { - new_string.to_string() + new_string.to_owned() } }) { write!(f, " '{}'", i.replace('\'', "''"))?;