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
However, this API only supports values from 1..=9 as documented here in the sources
Parameter blockSize100k specifies the block size to be used for compression. It should be a value between 1 and 9 inclusive, and the actual block size used is 100000 x this figure. 9 gives the best compression but takes most memory.
This bug seems to have been introduced in #37, where we tried to support an API aligned with flate2::Compression. However, our version of Compression::none will always panic on the above assertion with BZ_PARAM_ERROR
As the library doesnt appear to support disabling compression, I would prefer none to be deprecated, and a bounds check to be added to Compression::new. Hopefully there's a clean way to provide the equivalent of flate2's none and we can specifically branch on 0?
The text was updated successfully, but these errors were encountered:
We are directly passing
Compression::level
toBZ2_bzCompressInit
/~https://github.com/alexcrichton/bzip2-rs/blob/016e18155ef7c05983ea244cae1344c5b68defd8/src/mem.rs#L123-L126
However, this API only supports values from
1..=9
as documented here in the sourcesThis bug seems to have been introduced in #37, where we tried to support an API aligned with
flate2::Compression
. However, our version ofCompression::none
will always panic on the above assertion withBZ_PARAM_ERROR
/~https://github.com/alexcrichton/bzip2-rs/blob/016e18155ef7c05983ea244cae1344c5b68defd8/src/lib.rs#L100-L102
References
We had a panic in usage of
zip
over here :) zip-rs/zip-old#326Suggestions
As the library doesnt appear to support disabling compression, I would prefer
none
to be deprecated, and a bounds check to be added toCompression::new
. Hopefully there's a clean way to provide the equivalent of flate2'snone
and we can specifically branch on0
?The text was updated successfully, but these errors were encountered: