We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b884ed commit a3a1a02Copy full SHA for a3a1a02
src/lib.rs
@@ -254,6 +254,12 @@ impl Level {
254
#[cfg(feature = "zstd")]
255
fn into_zstd(self) -> i32 {
256
let (fastest, best) = libzstd::compression_level_range().into_inner();
257
+
258
+ // NOTE: zstd's "fastest" level is -131072 which can create outputs larger than inputs.
259
+ // This library chooses a "fastest" level which has a more-or-less equivalent compression
260
+ // ratio to gzip's fastest mode. We still allow precise levels to go negative.
261
+ // See discussion in https://github.com/Nullus157/async-compression/issues/352
262
263
match self {
264
Self::Fastest => fastest,
265
Self::Best => best,
0 commit comments