Skip to content

Commit

Permalink
Manually impl Defaut for CompressionMode
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Nov 20, 2022
1 parent 0535833 commit 3236b4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ use super::liblz4::*;
use std::io::{Error, ErrorKind, Result};

/// Represents the compression mode do be used.
#[derive(Default, Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug)]
pub enum CompressionMode {
/// High compression with compression parameter
HIGHCOMPRESSION(i32),
/// Fast compression with acceleration paramet
FAST(i32),
/// Default compression
#[default]
DEFAULT,
}

impl Default for CompressionMode {
fn default() -> Self {
CompressionMode::DEFAULT
}
}

/// Returns the size of the buffer that is guaranteed to hold the result of
/// compressing `uncompressed_size` bytes of in data. Returns std::io::Error
/// with ErrorKind::InvalidInput if input data is too long to be compressed by lz4.
Expand Down

0 comments on commit 3236b4b

Please sign in to comment.