fix: Implement Debug
for ZipWriter
even when it's not implemented for the inner writer's type
This commit is contained in:
parent
cf19487a55
commit
6366d45949
1 changed files with 9 additions and 1 deletions
10
src/write.rs
10
src/write.rs
|
@ -148,7 +148,6 @@ pub(crate) mod zip_writer {
|
||||||
/// # }
|
/// # }
|
||||||
/// # doit().unwrap();
|
/// # doit().unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct ZipWriter<W: Write + Seek> {
|
pub struct ZipWriter<W: Write + Seek> {
|
||||||
pub(super) inner: GenericZipWriter<W>,
|
pub(super) inner: GenericZipWriter<W>,
|
||||||
pub(super) files: IndexMap<Box<str>, ZipFileData>,
|
pub(super) files: IndexMap<Box<str>, ZipFileData>,
|
||||||
|
@ -158,6 +157,15 @@ pub(crate) mod zip_writer {
|
||||||
pub(super) comment: Box<[u8]>,
|
pub(super) comment: Box<[u8]>,
|
||||||
pub(super) flush_on_finish_file: bool,
|
pub(super) flush_on_finish_file: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<W: Write + Seek> Debug for ZipWriter<W> {
|
||||||
|
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)]
|
#[doc(inline)]
|
||||||
pub use self::sealed::FileOptionExtension;
|
pub use self::sealed::FileOptionExtension;
|
||||||
|
|
Loading…
Add table
Reference in a new issue