From 5bb31e355878c1ae970a552f43a89b71713ca7af Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:19:14 -0700 Subject: [PATCH] ci(fuzz): Bug fix: debug output was missing set_flush_on_finish_file --- fuzz/fuzz_targets/fuzz_write.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fuzz/fuzz_targets/fuzz_write.rs b/fuzz/fuzz_targets/fuzz_write.rs index 3a0b97e5..7cd51ab5 100755 --- a/fuzz/fuzz_targets/fuzz_write.rs +++ b/fuzz/fuzz_targets/fuzz_write.rs @@ -70,11 +70,12 @@ impl <'k> Debug for FileOperation<'k> { }, BasicFileOperation::MergeWithOtherFile {operations} => { f.write_str("let sub_writer = {\n\ - let mut writer = ZipWriter::new(Cursor::new(Vec::new()));\n")?; + let mut writer = ZipWriter::new(Cursor::new(Vec::new()));\n\ + writer.set_flush_on_finish_file(false);\n")?; operations.iter().map(|op| { f.write_fmt(format_args!("{:?}", op.0))?; if op.1 { - f.write_str("writer.abort_file()?;") + f.write_str("writer.abort_file()?;\n") } else { Ok(()) } @@ -195,10 +196,10 @@ where match operation.reopen { ReopenOption::DoNotReopen => {}, ReopenOption::ViaFinish => replace_with_or_abort(writer, |old_writer: zip::ZipWriter| { - zip::ZipWriter::new_append(old_writer.finish().unwrap()).unwrap() + zip::ZipWriter::new_append(old_writer.finish()?)? }), ReopenOption::ViaFinishIntoReadable => replace_with_or_abort(writer, |old_writer: zip::ZipWriter| { - zip::ZipWriter::new_append(old_writer.finish_into_readable().unwrap().into_inner()).unwrap() + zip::ZipWriter::new_append(old_writer.finish_into_readable()?.into_inner())? }), } assert_eq!(&old_comment, writer.get_raw_comment());