From 1eb4c1cc7752e2c63a220ab1b0dfdd04725477d7 Mon Sep 17 00:00:00 2001 From: Truman Kilen Date: Sun, 17 Sep 2023 18:34:42 -0500 Subject: [PATCH] Remove unwrap --- repak_cli/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/repak_cli/src/main.rs b/repak_cli/src/main.rs index be9d85a..d2d373b 100644 --- a/repak_cli/src/main.rs +++ b/repak_cli/src/main.rs @@ -363,7 +363,10 @@ fn unpack(aes_key: Option, action: ActionUnpack) -> Result<(), repa fs::create_dir_all(&entry.out_dir)?; pak.read_file( &entry.entry_path, - &mut BufReader::new(file.as_ref().unwrap()), // TODO: avoid this unwrap + &mut BufReader::new( + file.as_ref() + .map_err(|e| repak::Error::Other(format!("error reading pak: {e}")))?, + ), &mut fs::File::create(&entry.out_path)?, )?; progress.inc(1);