From 6d8de51bea354f83a0d031d5c658760d1283d676 Mon Sep 17 00:00:00 2001 From: Chris Hennick Date: Mon, 11 Mar 2024 13:32:58 -0700 Subject: [PATCH] Bug fix: expected error result now happens sooner --- src/read.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/read.rs b/src/read.rs index a9aedadd..bed33efc 100644 --- a/src/read.rs +++ b/src/read.rs @@ -1403,11 +1403,9 @@ mod test { #[cfg(feature = "deflate64")] #[test] - fn deflate64_not_enough_space() -> std::io::Result<()> { + fn deflate64_not_enough_space() { let mut v = Vec::new(); v.extend_from_slice(include_bytes!("../tests/data/deflate64_issue_25.zip")); - let mut reader = ZipArchive::new(Cursor::new(v))?; - std::io::copy(&mut reader.by_index(0)?, &mut std::io::sink()).expect_err("Invalid file"); - Ok(()) + ZipArchive::new(Cursor::new(v)).expect_err("Invalid file"); } }