Merge branch 'master' into issue-280-2
This commit is contained in:
commit
135cc54ba8
4 changed files with 18 additions and 39 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "zip"
|
name = "zip"
|
||||||
version = "1.1.1"
|
version = "1.1.2"
|
||||||
authors = [
|
authors = [
|
||||||
"Mathijs van de Nes <git@mathijs.vd-nes.nl>",
|
"Mathijs van de Nes <git@mathijs.vd-nes.nl>",
|
||||||
"Marli Frost <marli@frost.red>",
|
"Marli Frost <marli@frost.red>",
|
||||||
|
@ -56,6 +56,10 @@ aes-crypto = ["aes", "constant_time_eq", "hmac", "pbkdf2", "sha1"]
|
||||||
chrono = ["chrono/default"]
|
chrono = ["chrono/default"]
|
||||||
_deflate-any = []
|
_deflate-any = []
|
||||||
deflate = ["flate2/rust_backend", "_deflate-any"]
|
deflate = ["flate2/rust_backend", "_deflate-any"]
|
||||||
|
|
||||||
|
# DEPRECATED: previously enabled `flate2/miniz_oxide` which is equivalent to `flate2/rust_backend`
|
||||||
|
deflate-miniz = ["deflate", "_deflate-any"]
|
||||||
|
|
||||||
deflate-zlib = ["flate2/zlib", "_deflate-any"]
|
deflate-zlib = ["flate2/zlib", "_deflate-any"]
|
||||||
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-any"]
|
deflate-zlib-ng = ["flate2/zlib-ng", "_deflate-any"]
|
||||||
deflate-zopfli = ["zopfli", "_deflate-any"]
|
deflate-zopfli = ["zopfli", "_deflate-any"]
|
||||||
|
|
|
@ -47,6 +47,10 @@ The features available are:
|
||||||
|
|
||||||
By default `aes-crypto`, `deflate`, `deflate-zlib-ng`, `deflate-zopfli`, `bzip2`, `time` and `zstd` are enabled.
|
By default `aes-crypto`, `deflate`, `deflate-zlib-ng`, `deflate-zopfli`, `bzip2`, `time` and `zstd` are enabled.
|
||||||
|
|
||||||
|
The following feature flags are deprecated:
|
||||||
|
|
||||||
|
* `deflate-miniz`: Use `flate2`'s default backend for compression. Currently the same as `deflate`.
|
||||||
|
|
||||||
MSRV
|
MSRV
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,7 @@ pub enum CompressionMethod {
|
||||||
/// Store the file as is
|
/// Store the file as is
|
||||||
Stored,
|
Stored,
|
||||||
/// Compress the file using Deflate
|
/// Compress the file using Deflate
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
))]
|
|
||||||
Deflated,
|
Deflated,
|
||||||
/// Compress the file using Deflate64.
|
/// Compress the file using Deflate64.
|
||||||
/// Decoding deflate64 is supported but encoding deflate64 is not supported.
|
/// Decoding deflate64 is supported but encoding deflate64 is not supported.
|
||||||
|
@ -60,19 +55,9 @@ impl CompressionMethod {
|
||||||
pub const REDUCE_3: Self = CompressionMethod::Unsupported(4);
|
pub const REDUCE_3: Self = CompressionMethod::Unsupported(4);
|
||||||
pub const REDUCE_4: Self = CompressionMethod::Unsupported(5);
|
pub const REDUCE_4: Self = CompressionMethod::Unsupported(5);
|
||||||
pub const IMPLODE: Self = CompressionMethod::Unsupported(6);
|
pub const IMPLODE: Self = CompressionMethod::Unsupported(6);
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
))]
|
|
||||||
pub const DEFLATE: Self = CompressionMethod::Deflated;
|
pub const DEFLATE: Self = CompressionMethod::Deflated;
|
||||||
#[cfg(not(any(
|
#[cfg(not(feature = "_deflate-any"))]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
)))]
|
|
||||||
pub const DEFLATE: Self = CompressionMethod::Unsupported(8);
|
pub const DEFLATE: Self = CompressionMethod::Unsupported(8);
|
||||||
#[cfg(feature = "deflate64")]
|
#[cfg(feature = "deflate64")]
|
||||||
pub const DEFLATE64: Self = CompressionMethod::Deflate64;
|
pub const DEFLATE64: Self = CompressionMethod::Deflate64;
|
||||||
|
@ -114,12 +99,7 @@ impl CompressionMethod {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
match val {
|
match val {
|
||||||
0 => CompressionMethod::Stored,
|
0 => CompressionMethod::Stored,
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
))]
|
|
||||||
8 => CompressionMethod::Deflated,
|
8 => CompressionMethod::Deflated,
|
||||||
#[cfg(feature = "deflate64")]
|
#[cfg(feature = "deflate64")]
|
||||||
9 => CompressionMethod::Deflate64,
|
9 => CompressionMethod::Deflate64,
|
||||||
|
@ -145,12 +125,7 @@ impl CompressionMethod {
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
match self {
|
match self {
|
||||||
CompressionMethod::Stored => 0,
|
CompressionMethod::Stored => 0,
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
))]
|
|
||||||
CompressionMethod::Deflated => 8,
|
CompressionMethod::Deflated => 8,
|
||||||
#[cfg(feature = "deflate64")]
|
#[cfg(feature = "deflate64")]
|
||||||
CompressionMethod::Deflate64 => 9,
|
CompressionMethod::Deflate64 => 9,
|
||||||
|
@ -173,11 +148,12 @@ impl Default for CompressionMethod {
|
||||||
#[cfg(feature = "_deflate-any")]
|
#[cfg(feature = "_deflate-any")]
|
||||||
return CompressionMethod::Deflated;
|
return CompressionMethod::Deflated;
|
||||||
|
|
||||||
#[cfg(all(not(any(feature = "_deflate-any")), feature = "bzip2"))]
|
#[cfg(all(not(feature = "_deflate-any"), feature = "bzip2"))]
|
||||||
return CompressionMethod::Bzip2;
|
return CompressionMethod::Bzip2;
|
||||||
|
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(any(feature = "_deflate-any", feature = "bzip2")),
|
not(feature = "_deflate-any"),
|
||||||
|
not(feature = "bzip2"),
|
||||||
feature = "zstd"
|
feature = "zstd"
|
||||||
))]
|
))]
|
||||||
return CompressionMethod::Zstd;
|
return CompressionMethod::Zstd;
|
||||||
|
|
|
@ -1299,12 +1299,7 @@ impl<W: Write + Seek> GenericZipWriter<W> {
|
||||||
Ok(Box::new(|bare| Storer(bare)))
|
Ok(Box::new(|bare| Storer(bare)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(any(
|
#[cfg(feature = "_deflate-any")]
|
||||||
feature = "deflate",
|
|
||||||
feature = "deflate-zlib",
|
|
||||||
feature = "deflate-zlib-ng",
|
|
||||||
feature = "deflate-zopfli"
|
|
||||||
))]
|
|
||||||
CompressionMethod::Deflated => {
|
CompressionMethod::Deflated => {
|
||||||
let default = if cfg!(feature = "deflate-zopfli") {
|
let default = if cfg!(feature = "deflate-zopfli") {
|
||||||
24
|
24
|
||||||
|
|
Loading…
Add table
Reference in a new issue