upgraded shlex 1.2 to 1.3

This commit is contained in:
ascendforever 2024-10-13 17:55:31 -04:00
parent 82474262b8
commit 6c9d912df3
2 changed files with 5 additions and 5 deletions

View file

@ -7,5 +7,5 @@ edition = "2021"
[dependencies]
chrono = "0.4"
shlex = "1.2"
shlex = "1.3"
structopt = "0.3"

View file

@ -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()
)
}
}