diff --git a/Cargo.toml b/Cargo.toml index bbd1f3fe7..2115d6f5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,7 @@ deflate-flate2 = ["_deflate-any"] deflate-miniz = ["deflate", "deflate-flate2"] deflate-zlib = ["flate2/zlib", "deflate-flate2"] deflate-zlib-ng = ["flate2/zlib-ng", "deflate-flate2"] +deflate-zlib-rs = ["flate2/zlib-rs", "deflate-flate2"] deflate-zopfli = ["zopfli", "_deflate-any"] lzma = ["lzma-rs/stream"] unreserved = [] diff --git a/examples/write_dir.rs b/examples/write_dir.rs index 5fe41dc87..31be77dac 100644 --- a/examples/write_dir.rs +++ b/examples/write_dir.rs @@ -27,6 +27,7 @@ enum CompressionMethod { Deflated, DeflatedZlib, DeflatedZlibNg, + DeflatedZlibRs, Bzip2, Zstd, } @@ -68,6 +69,15 @@ fn real_main() -> i32 { #[cfg(feature = "deflate-zlib-ng")] zip::CompressionMethod::Deflated } + CompressionMethod::DeflatedZlibRs => { + #[cfg(not(feature = "deflate-zlib-rs"))] + { + println!("The `deflate-zlib-rs` feature is not enabled"); + return 1; + } + #[cfg(feature = "deflate-zlib-rs")] + zip::CompressionMethod::Deflated + } CompressionMethod::Bzip2 => { #[cfg(not(feature = "bzip2"))] {