Skip to content

Commit

Permalink
refactor: Merge the hidden deflate-flate2 flag into the public one
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed May 21, 2024
1 parent 870f915 commit a731f2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ tempdir = "0.3.7"
aes-crypto = ["aes", "constant_time_eq", "hmac", "pbkdf2", "sha1", "rand", "zeroize"]
chrono = ["chrono/default"]
_deflate-any = []
_deflate-flate2 = ["_deflate-any"]
_all-features = [] # Detect when --all-features is used
deflate = ["flate2/rust_backend", "_deflate-flate2"]

deflate = ["flate2/rust_backend", "deflate-flate2"]
deflate-flate2 = ["flate2/any_impl", "_deflate-any"]
# DEPRECATED: previously enabled `flate2/miniz_oxide` which is equivalent to `flate2/rust_backend`
deflate-miniz = ["deflate", "_deflate-flate2"]

deflate-zlib = ["flate2/zlib", "_deflate-flate2"]
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-flate2"]
deflate-miniz = ["deflate", "deflate-flate2"]
deflate-zlib = ["flate2/zlib", "deflate-flate2"]
deflate-zlib-ng = ["flate2/zlib-ng", "deflate-flate2"]
deflate-zopfli = ["zopfli", "_deflate-any"]
lzma = ["lzma-rs/stream"]
unreserved = []
Expand Down
4 changes: 2 additions & 2 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ impl<W: Write + Seek> GenericZipWriter<W> {
}
#[cfg(feature = "_deflate-any")]
CompressionMethod::Deflated => {
let default = if cfg!(all(feature = "deflate-zopfli", not(feature = "_deflate-flate2"))) {
let default = if cfg!(all(feature = "deflate-zopfli", not(feature = "deflate-flate2"))) {
24
} else {
Compression::default().level() as i64
Expand Down Expand Up @@ -1694,7 +1694,7 @@ impl<W: Write + Seek> GenericZipWriter<W> {

#[cfg(feature = "_deflate-any")]
fn deflate_compression_level_range() -> std::ops::RangeInclusive<i64> {
let min = if cfg!(feature = "_deflate-flate2")
let min = if cfg!(feature = "deflate-flate2")
{
Compression::fast().level() as i64
} else {
Expand Down

0 comments on commit a731f2a

Please sign in to comment.