Skip to content

Commit

Permalink
Only enable Builder::window_bits for zlib feature.
Browse files Browse the repository at this point in the history
Also use `assert_eq` instead of `debug_assert_eq!`.
  • Loading branch information
twittner committed Jun 7, 2019
1 parent 338d97a commit 84a62bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ impl<T> Builder<T> {
/// # Panics
///
/// If `bits` does not fall into the range 9 ..= 15.
#[cfg(feature = "zlib")]
pub fn window_bits(&mut self, bits: u8) -> &mut Self {
assert!(bits > 8 && bits < 16, "window bits must be within 9 ..= 15");
self.window_bits = bits as c_int;
Expand Down Expand Up @@ -251,7 +252,7 @@ impl Builder<Compress> {
9,
ffi::MZ_DEFAULT_STRATEGY,
);
debug_assert_eq!(ret, 0);
assert_eq!(ret, 0);
Compress {
inner: Stream {
stream_wrapper: state,
Expand All @@ -277,7 +278,7 @@ impl Builder<Decompress> {
-self.window_bits
},
);
debug_assert_eq!(ret, 0);
assert_eq!(ret, 0);
Decompress {
inner: Stream {
stream_wrapper: state,
Expand Down

0 comments on commit 84a62bb

Please sign in to comment.