Merge pull request #348 from Shnatsel/deflate-level

Expose precise DEFLATE level controls
This commit is contained in:
Sergey "Shnatsel" Davidoff authored and GitHub committed 2026-03-05 17:23:59 +00:00
commit 0fe5b2804e
1 file changed
+12
+12
View File
@@ -29,6 +29,18 @@ impl Deflate {
level: FlateCompression::new(level as u32),
}
}
/// Create a new deflate compressor with an exact level of compression.
///
/// `0` stands for uncompressed
/// `1` stands for light but fast compression
/// `6` is the recommended balanced default
/// `9` is maximum compression ratio at the cost of slow encoding
pub fn exact_level(level: u8) -> Self {
Self {
level: FlateCompression::new(level as u32),
}
}
}
impl Default for Deflate {