mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +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() {
|
for idx in 0..archive.len() {
|
||||||
let mut file = match password {
|
let mut file = match password {
|
||||||
Some(password) => archive
|
Some(password) => archive
|
||||||
.by_index_decrypt(idx, password.to_owned().as_bytes())
|
.by_index_decrypt(idx, password.to_owned().as_bytes())?
|
||||||
.unwrap()
|
|
||||||
.map_err(|_| zip::result::ZipError::UnsupportedArchive("Password required to decrypt file"))?,
|
.map_err(|_| zip::result::ZipError::UnsupportedArchive("Password required to decrypt file"))?,
|
||||||
None => archive.by_index(idx)?,
|
None => archive.by_index(idx)?,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user