Skip to content

Commit

Permalink
Add compression level
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosc90 committed Jul 11, 2024
1 parent 2cfde02 commit fc7774e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ pub enum Compression {
note = "use one of the other compression levels instead, such as 'fast'"
)]
Rle,
/// integer representing the compression level, typically on a scale of 0-9
Level(u32),
}

impl Default for Compression {
Expand Down
1 change: 1 addition & 0 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@ impl Compression {
Compression::Default => flate2::Compression::default(),
Compression::Fast => flate2::Compression::fast(),
Compression::Best => flate2::Compression::best(),
Compression::Level(level) => flate2::Compression::new(level),
#[allow(deprecated)]
Compression::Huffman => flate2::Compression::none(),
#[allow(deprecated)]
Expand Down

0 comments on commit fc7774e

Please sign in to comment.