You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When selecting only _deflate-any or deflate-flate2 feature with default-features turned off it's not possible to compile zip crate. Both features are missing some flate2 dependencies.
To Reproduce
In Cargo.toml use this dependency settings
zip = { version = "2.1.6", default-features = false, features = ["_deflate-any"] }
Expected behavior
Feature should enable all necessary components to successfully compile or at least provide compilation error with message which features user should add.
Temporary solution
In Cargo.toml use this dependency settings (with added deflate feature)
zip = { version = "2.1.6", default-features = false, features = ["_deflate-any", "deflate"] }
Possible fix
For _deflate-any add deflate-flate2 and for deflate-flate2 add flate2/rust_backend (produces unused import warning).
Produced errors (_deflate-any, for deflate-flate2 are different)
error[E0433]: failed to resolve: use of undeclared crate or module `flate2`
--> /zip2/src/compression.rs:195:14
|
195 | Deflated(flate2::bufread::DeflateDecoder<R>),
| ^^^^^^ use of undeclared crate or module `flate2`
error[E0433]: failed to resolve: use of undeclared crate or module `flate2`
--> /zip2/src/compression.rs:234:40
|
234 | Decompressor::Deflated(flate2::bufread::DeflateDecoder::new(reader))
| ^^^^^^ use of undeclared crate or module `flate2`
warning: unused import: `core::num::NonZeroU64`
--> /zip2/src/write.rs:19:5
|
19 | use core::num::NonZeroU64;
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error[E0433]: failed to resolve: use of undeclared type `Compression`
--> /zip2/src/write.rs:1597:25
|
1597 | Compression::default().level() as i64
| ^^^^^^^^^^^ use of undeclared type `Compression`
error[E0308]: mismatched types
--> /zip2/src/write.rs:1590:48
|
1590 | CompressionMethod::Deflated => {
| ________________________________________________^
1591 | | let default = if cfg!(all(
1592 | | feature = "deflate-zopfli",
1593 | | not(feature = "deflate-flate2")
... |
1644 | | }
1645 | | }
| |_________________^ expected `Result<Box<...>, ...>`, found `()`
|
= note: expected enum `Result<Box<(dyn FnOnce(MaybeEncrypted<W>) -> write::GenericZipWriter<W> + 'static)>, ZipError>`
found unit type `()`
error[E0433]: failed to resolve: use of undeclared type `Compression`
--> /zip2/src/write.rs:1761:9
|
1761 | Compression::fast().level() as i64
| ^^^^^^^^^^^ use of undeclared type `Compression`
error[E0433]: failed to resolve: use of undeclared type `Compression`
--> /zip2/src/write.rs:1763:9
|
1763 | Compression::best().level() as i64 + 1
| ^^^^^^^^^^^ use of undeclared type `Compression`
error[E0433]: failed to resolve: use of undeclared type `Compression`
--> /zip2/src/write.rs:1766:15
|
1766 | let max = Compression::best().level() as i64
| ^^^^^^^^^^^ use of undeclared type `Compression`
The text was updated successfully, but these errors were encountered:
features starting with _ are private features. They are not to be relied on by external users.
See the relevant cargo issue for the discussion rust-lang/cargo#10882
Describe the bug
When selecting only
_deflate-any
ordeflate-flate2
feature withdefault-features
turned off it's not possible to compile zip crate. Both features are missing someflate2
dependencies.To Reproduce
In
Cargo.toml
use this dependency settingsExpected behavior
Feature should enable all necessary components to successfully compile or at least provide compilation error with message which features user should add.
Temporary solution
In
Cargo.toml
use this dependency settings (with addeddeflate
feature)Possible fix
For
_deflate-any
adddeflate-flate2
and fordeflate-flate2
addflate2/rust_backend
(producesunused import
warning).Produced errors (
_deflate-any
, fordeflate-flate2
are different)The text was updated successfully, but these errors were encountered: