mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
fix(archive): replace unwrap with error handling in zip.rs
This commit is contained in:
parent
2dad11d0ba
commit
309d165606
@ -45,8 +45,7 @@ where
|
||||
for idx in 0..archive.len() {
|
||||
let mut file = match password {
|
||||
Some(password) => archive
|
||||
.by_index_decrypt(idx, password.to_owned().as_bytes())
|
||||
.unwrap()
|
||||
.by_index_decrypt(idx, password.to_owned().as_bytes())?
|
||||
.map_err(|_| zip::result::ZipError::UnsupportedArchive("Password required to decrypt file"))?,
|
||||
None => archive.by_index(idx)?,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user