From 6c9d912df3f0ac6e812347d562b0539e518ad94a Mon Sep 17 00:00:00 2001 From: ascendforever Date: Sun, 13 Oct 2024 17:55:31 -0400 Subject: [PATCH] upgraded shlex 1.2 to 1.3 --- Cargo.toml | 2 +- src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4b68c78..882eebf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [dependencies] chrono = "0.4" -shlex = "1.2" +shlex = "1.3" structopt = "0.3" diff --git a/src/main.rs b/src/main.rs index f4f3be7..e446513 100644 --- a/src/main.rs +++ b/src/main.rs @@ -75,10 +75,10 @@ impl<'a> Registry<'a> { pub fn write_all(&self, writer: &mut impl Write, separator_null: bool, quote: bool) -> std::io::Result<()> { if separator_null { - if quote { for (_,file) in &self.registry { write!(writer, "{}\0", shlex::quote(&file.to_string_lossy()))?; } } + if quote { for (_,file) in &self.registry { write!(writer, "{}\0", shlex::try_quote(&file.to_string_lossy()).unwrap())?; } } else { for (_,file) in &self.registry { write!(writer, "{}\0", &file.to_string_lossy() )?; } } } else { - if quote { for (_,file) in &self.registry { writeln!(writer, "{}", shlex::quote(&file.to_string_lossy()))?; } } + if quote { for (_,file) in &self.registry { writeln!(writer, "{}", shlex::try_quote(&file.to_string_lossy()).unwrap())?; } } else { for (_,file) in &self.registry { writeln!(writer, "{}", &file.to_string_lossy() )?; } } } Ok(()) @@ -112,8 +112,8 @@ impl<'a> Registry<'a> { }, None => eprintln!( "Cannot read non-utf-8 file extension: {} on {}", - shlex::quote(&osstr_ext.to_string_lossy()), - shlex::quote(&path.to_string_lossy()) + shlex::try_quote(&osstr_ext.to_string_lossy()).unwrap(), + shlex::try_quote(&path.to_string_lossy()).unwrap() ) } }