diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 44493f2d..046eb81c 100644 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -2,7 +2,7 @@ use arbitrary::Arbitrary; use libfuzzer_sys::fuzz_target; -use replace_with::replace_with; +use replace_with::replace_with_or_abort; use std::io::{Cursor, Read, Seek, Write}; use std::path::PathBuf; @@ -83,9 +83,7 @@ where } if operation.reopen { let old_comment = writer.get_raw_comment().to_owned(); - replace_with(writer, || { - panic!("Failed to reopen writer"); - }, |old_writer: zip::ZipWriter| { + replace_with_or_abort(writer, |old_writer: zip::ZipWriter| { let new_writer = zip::ZipWriter::new_append(old_writer.finish().unwrap()).unwrap(); assert_eq!(&old_comment, new_writer.get_raw_comment());