File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -193,9 +193,17 @@ impl Compression {
193
193
/// The integer here is typically on a scale of 0-9 where 0 means "no
194
194
/// compression" and 9 means "take as long as you'd like".
195
195
///
196
- /// It is worth noting that `flate2` supports both `zlib` and `miniz`
197
- /// backends for compression, where `miniz` also provides a level `10` of
198
- /// compression.
196
+ /// ### Backend differences
197
+ ///
198
+ /// The [`miniz_oxide`](https://crates.io/crates/miniz_oxide) backend for flate2
199
+ /// does not support level 0 or `Compression::none()`. Instead it interprets them
200
+ /// as the default compression level. Using `Compression::fast()` is recommended instead
201
+ /// when using the `miniz_oxide` backend.
202
+ ///
203
+ /// `miniz_oxide` also supports a non-compliant compression level 10.
204
+ /// It is even slower and may result in higher compression, but
205
+ /// **only miniz_oxide will be able to read the data** compressed with level 10.
206
+ /// Do **not** use level 10 if you need other software to be able to read it!
199
207
pub const fn new ( level : u32 ) -> Compression {
200
208
Compression ( level)
201
209
}
@@ -217,7 +225,7 @@ impl Compression {
217
225
}
218
226
219
227
/// Returns an integer representing the compression level, typically on a
220
- /// scale of 0-9. With `miniz` backend, level 10 is also possible .
228
+ /// scale of 0-9. See [`new`](Self::new) for details about compression levels .
221
229
pub fn level ( & self ) -> u32 {
222
230
self . 0
223
231
}
You can’t perform that action at this time.
0 commit comments