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 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 9 --------- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f300522..fd1f7e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -94,7 +94,7 @@ checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" [[package]] name = "mmv" -version = "1.0.0" +version = "1.0.1" dependencies = [ "cerm", "itertools", diff --git a/Cargo.toml b/Cargo.toml index 37ecfba..de42a89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mmv" -version = "1.0.0" +version = "1.0.1" edition = "2021" license = "0BSD" description = "Mapped file moves" 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