on master help sign in
Use to_string_lossy
commit98ba9e010162ed2cd7714c95c505ea0839e28395 authorsharkdp <davidpeter@web.de> dateSat 18 Apr 2020, 11:39 (7 years ago) parent1b8ce60
1 file changed+1−1
src/printer.rs+1−1
src/printer.rs+1−1
@@ -237,7 +237,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
237237 InputFile::Ordinary(ofile) => {
238238 format!("file '{}'", &ofile.filename().to_string_lossy())
239239 }
240− InputFile::StdIn(Some(name)) => name.to_str().unwrap().to_string(),
240+ InputFile::StdIn(Some(name)) => name.to_string_lossy().into_owned(),
241241 InputFile::StdIn(None) => "STDIN".to_owned(),
242242 InputFile::ThemePreviewFile => "".to_owned(),
243243 };