diff --git a/src/write.rs b/src/write.rs index 40f0b1c9..6ede289b 100644 --- a/src/write.rs +++ b/src/write.rs @@ -148,7 +148,6 @@ pub(crate) mod zip_writer { /// # } /// # doit().unwrap(); /// ``` - #[derive(Debug)] pub struct ZipWriter { pub(super) inner: GenericZipWriter, pub(super) files: IndexMap, ZipFileData>, @@ -158,6 +157,15 @@ pub(crate) mod zip_writer { pub(super) comment: Box<[u8]>, pub(super) flush_on_finish_file: bool, } + + impl Debug for ZipWriter { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_fmt(format_args!( + "ZipWriter {{files: {:?}, stats: {:?}, writing_to_file: {}, writing_raw: {}, comment: {:?}, flush_on_finish_file: {}}}", + self.files, self.stats, self.writing_to_file, self.writing_raw, + String::from_utf8(self.comment.to_vec()), self.flush_on_finish_file)) + } + } } #[doc(inline)] pub use self::sealed::FileOptionExtension;