From 9491e4e16dbcd4d799ec475e461f1008cc319ff1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 12 Aug 2023 15:36:17 +0200 Subject: We can terminate with EOF when using -i --- src/main.rs | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 14ddcb9..def98c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -263,7 +263,6 @@ fn run_indiv( src.to_owned() } )?; - ci.write_all(if flags.nul { &[b'\0'] } else { &[b'\n'] })?; } let mut co = child.stdout.take().unwrap_or_else(|| { @@ -271,14 +270,6 @@ fn run_indiv( }); let mut s = String::with_capacity(src.len()); co.read_to_string(&mut s)?; - match s.chars().last().unwrap_or_else(|| { - err!("Filename can’t be the empty string"); - }) { - '\n' | '\0' => { - s.pop(); - } - _ => {} - }; dsts.push(if flags.encode { decode_string(s.as_str()) } else { -- cgit v1.2.3