lzma-rs
lzma-rs copied to clipboard
Provide features to import parts of the crate
For now, dependents of lzma-rs import all of LZMA, LZMA2 and XZ, even if they only need LZMA for example. This could lead to unnecessary dependencies if for example SHA-256 checksums are added for the XZ layer (https://github.com/gendx/lzma-rs/issues/32).
In the next breaking release, the code could be split with Cargo features:
- by default, lzma is available,
- the
lzma2feature enables lzma2 on top of it, - the
xzfeature enables all of lzma, lzma2 and xz, - the
sha256feature enables support for SHA-256 checksums (instead of returning anErr) - only relevant forxz.
- The
enable_loggingfeature shouldn't bring theenv_loggerdependency -env_loggershould be a dev-dependency only.
This doesn't need to be a breaking release if default imports everything. It would be an opt-out rather than opt-in but can be done without a major version increment.
Might I also suggest having encode being it's own feature as well?
This doesn't need to be a breaking release if
defaultimports everything. It would be an opt-out rather than opt-in but can be done without a major version increment.
If something already depends on lzma-rs with default-features = false, it would break them. So this is a breaking change. But given that lzma-rs is still not stable (currently version 0.2.0), I think that it's totally fine to increment the major version (i.e. 0.3.x).
Might I also suggest having encode being it's own feature as well?
Sounds good, especially given that the current implementation doesn't try to compress much (see #9).