From e0e69f6315e3f754358484d44b791227793d6082 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 24 Oct 2024 11:57:44 -0400 Subject: [PATCH] tests: Just use `unwrap()` (#384) 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 --- tests/all.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/all.rs b/tests/all.rs index eff0e4da..0d1b79db 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -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 { @@ -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); }