diff --git a/src/write.rs b/src/write.rs index 418eb637..59d325f9 100644 --- a/src/write.rs +++ b/src/write.rs @@ -59,6 +59,7 @@ impl Debug for MaybeEncrypted { // Don't print W, since it may be a huge Vec f.write_str(match self { MaybeEncrypted::Unencrypted(_) => "Unencrypted", + #[cfg(feature = "aes-crypto")] MaybeEncrypted::Aes(_) => "AES", MaybeEncrypted::ZipCrypto(_) => "ZipCrypto" }) @@ -87,11 +88,7 @@ impl Write for MaybeEncrypted { enum GenericZipWriter { Closed, Storer(MaybeEncrypted), - #[cfg(any( - feature = "deflate", - feature = "deflate-zlib", - feature = "deflate-zlib-ng" - ))] + #[cfg(feature = "deflate-flate2")] Deflater(DeflateEncoder>), #[cfg(feature = "deflate-zopfli")] ZopfliDeflater(zopfli::DeflateEncoder>), @@ -108,11 +105,16 @@ impl Debug for GenericZipWriter { match self { Closed => f.write_str("Closed"), Storer(w) => f.write_fmt(format_args!("Storer({:?})", w)), - GenericZipWriter::Deflater(_) => f.write_str("Deflater"), + #[cfg(feature = "deflate-flate2")] + GenericZipWriter::Deflater(w) => f.write_fmt(format_args!("Deflater({:?})", w.get_ref())), + #[cfg(feature = "deflate-zopfli")] GenericZipWriter::ZopfliDeflater(_) => f.write_str("ZopfliDeflater"), + #[cfg(feature = "deflate-zopfli")] GenericZipWriter::BufferedZopfliDeflater(_) => f.write_str("BufferedZopfliDeflater"), - GenericZipWriter::Bzip2(_) => f.write_str("Bzip2"), - GenericZipWriter::Zstd(_) => f.write_str("Zstd"), + #[cfg(feature = "bzip2")] + GenericZipWriter::Bzip2(w) => f.write_fmt(format_args!("Bzip2({:?})", w.get_ref())), + #[cfg(feature = "zstd")] + GenericZipWriter::Zstd(w) => f.write_fmt(format_args!("Zstd({:?})", w.get_ref())), } } }