Skip to content

Commit

Permalink
unwrap instead of let _
Browse files Browse the repository at this point in the history
I really prefer using at least unwrap here. If this never happens,
they're equivalent, but if it does happen, with the old code, you
silently continue, and with the new code, you blow up.
  • Loading branch information
steveklabnik committed Jul 13, 2023
1 parent cc9c0e2 commit 909d8ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/tarball/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub async fn download_and_extract(
let tar_gz = File::open(&tarball_location).unwrap();
let tar = GzDecoder::new(tar_gz);
let mut archive = Archive::new(tar);
let _ = archive.unpack(&extract_location);
archive.unpack(&extract_location).unwrap();

std::fs::remove_file(&tarball_location)
.or(Err(TarballError::FileSystem("removing tarball failed".to_owned())))
Expand Down

0 comments on commit 909d8ad

Please sign in to comment.