Skip to content

Commit d4aebe1

Browse files
committed
feat: reorder FlushCompress variants to be in order with value
1 parent a6cac49 commit d4aebe1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/ffi/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl From<FlushCompress> for MZFlush {
136136
fn from(value: FlushCompress) -> Self {
137137
match value {
138138
FlushCompress::None => Self::None,
139-
FlushCompress::Sync | FlushCompress::Partial => Self::Sync,
139+
FlushCompress::Partial | FlushCompress::Sync => Self::Sync,
140140
FlushCompress::Full => Self::Full,
141141
FlushCompress::Finish => Self::Finish,
142142
}

src/mem.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ pub enum FlushCompress {
4949
/// accumulate before producing output in order to maximize compression.
5050
None = ffi::MZ_NO_FLUSH as isize,
5151

52-
/// All pending output is flushed to the output buffer and the output is
53-
/// aligned on a byte boundary so that the decompressor can get all input
54-
/// data available so far.
55-
///
56-
/// Flushing may degrade compression for some compression algorithms and so
57-
/// it should only be used when necessary. This will complete the current
58-
/// deflate block and follow it with an empty stored block.
59-
Sync = ffi::MZ_SYNC_FLUSH as isize,
60-
6152
/// All pending output is flushed to the output buffer, but the output is
6253
/// not aligned to a byte boundary.
6354
///
@@ -68,6 +59,15 @@ pub enum FlushCompress {
6859
/// block before the empty fixed code block.
6960
Partial = ffi::MZ_PARTIAL_FLUSH as isize,
7061

62+
/// All pending output is flushed to the output buffer and the output is
63+
/// aligned on a byte boundary so that the decompressor can get all input
64+
/// data available so far.
65+
///
66+
/// Flushing may degrade compression for some compression algorithms and so
67+
/// it should only be used when necessary. This will complete the current
68+
/// deflate block and follow it with an empty stored block.
69+
Sync = ffi::MZ_SYNC_FLUSH as isize,
70+
7171
/// All output is flushed as with `Flush::Sync` and the compression state is
7272
/// reset so decompression can restart from this point if previous
7373
/// compressed data has been damaged or if random access is desired.

0 commit comments

Comments
 (0)