mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
compressors/zip: replace a couple of unwraps to the question mark op.
This commit is contained in:
parent
8e37078043
commit
49e4c4afcd
@ -57,7 +57,7 @@ impl ZipCompressor {
|
||||
for filename in input_filenames {
|
||||
|
||||
let previous_location = utils::change_dir_and_return_parent(&filename)?;
|
||||
let filename = filename.file_name().unwrap();
|
||||
let filename = filename.file_name()?;
|
||||
|
||||
for entry in WalkDir::new(filename) {
|
||||
let entry = entry?;
|
||||
@ -73,7 +73,7 @@ impl ZipCompressor {
|
||||
std::env::set_current_dir(previous_location)?;
|
||||
}
|
||||
|
||||
let bytes = writer.finish().unwrap();
|
||||
let bytes = writer.finish()?;
|
||||
|
||||
Ok(bytes.into_inner())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user