upgraded shlex 1.2 to 1.3
This commit is contained in:
parent
82474262b8
commit
6c9d912df3
2 changed files with 5 additions and 5 deletions
|
@ -7,5 +7,5 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
shlex = "1.2"
|
shlex = "1.3"
|
||||||
structopt = "0.3"
|
structopt = "0.3"
|
||||||
|
|
|
@ -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<()> {
|
pub fn write_all(&self, writer: &mut impl Write, separator_null: bool, quote: bool) -> std::io::Result<()> {
|
||||||
if separator_null {
|
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 { for (_,file) in &self.registry { write!(writer, "{}\0", &file.to_string_lossy() )?; } }
|
||||||
} else {
|
} 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() )?; } }
|
else { for (_,file) in &self.registry { writeln!(writer, "{}", &file.to_string_lossy() )?; } }
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -112,8 +112,8 @@ impl<'a> Registry<'a> {
|
||||||
},
|
},
|
||||||
None => eprintln!(
|
None => eprintln!(
|
||||||
"Cannot read non-utf-8 file extension: {} on {}",
|
"Cannot read non-utf-8 file extension: {} on {}",
|
||||||
shlex::quote(&osstr_ext.to_string_lossy()),
|
shlex::try_quote(&osstr_ext.to_string_lossy()).unwrap(),
|
||||||
shlex::quote(&path.to_string_lossy())
|
shlex::try_quote(&path.to_string_lossy()).unwrap()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue