using except for option.

This commit is contained in:
licsber 2024-09-08 00:16:26 +08:00
parent 5c4a6b6bf1
commit 3edc4369f4

View File

@ -15,7 +15,7 @@ fn process_compressed_files(path: &Path) -> io::Result<()> {
if ext == "rar" || ext == "zip" {
println!("UNAR: {}", entry_path.display());
let parent_dir = entry_path.parent().unwrap();
let filename = entry_path.file_name().to_str().unwrap();
let filename = entry_path.file_name().expect("WRONG.").to_str().unwrap();
let output = Command::new("unar")
.current_dir(parent_dir)
.arg(filename)