Skip to content

Commit

Permalink
tests: Just use unwrap() (#384)
Browse files Browse the repository at this point in the history
I don't think this unique-to-us `t!` macro is gaining anything
really over just calling `unwrap()` directly which is *way*
more widely used and idiomatic.

I only converted a few testing functions to start momentum
and hopefully new code can avoid `t!`.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters authored Oct 24, 2024
1 parent 9bd1372 commit e0e69f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ fn reading_entries() {
fn reading_entries_with_seek() {
let rdr = Cursor::new(tar!("reading_files.tar"));
let mut ar = Archive::new(rdr);
reading_entries_common(t!(ar.entries_with_seek()));
reading_entries_common(ar.entries_with_seek().unwrap());
}

struct LoggingReader<R> {
Expand Down Expand Up @@ -293,10 +293,10 @@ fn check_dirtree(td: &TempDir) {

#[test]
fn extracting_directories() {
let td = t!(TempBuilder::new().prefix("tar-rs").tempdir());
let td = TempBuilder::new().prefix("tar-rs").tempdir().unwrap();
let rdr = Cursor::new(tar!("directory.tar"));
let mut ar = Archive::new(rdr);
t!(ar.unpack(td.path()));
ar.unpack(td.path()).unwrap();
check_dirtree(&td);
}

Expand Down

0 comments on commit e0e69f6

Please sign in to comment.