Add LZ4 as a built in compression engine
This commit is contained in:
@@ -24,4 +24,5 @@ humansize = "2.1.3"
|
|||||||
enum-map = "2.6.1"
|
enum-map = "2.6.1"
|
||||||
is-terminal = "0.4.9"
|
is-terminal = "0.4.9"
|
||||||
term = "0.7.0"
|
term = "0.7.0"
|
||||||
|
lz4_flex = "0.11.1"
|
||||||
|
|
||||||
|
|||||||
13
src/main.rs
13
src/main.rs
@@ -650,14 +650,14 @@ fn mode_status(_cmd: &mut Command, args: Args, data_path: PathBuf, db_path: Path
|
|||||||
};
|
};
|
||||||
|
|
||||||
for compression_type in CompressionType::iter() {
|
for compression_type in CompressionType::iter() {
|
||||||
let compression_program = match compression_type {
|
let compression_program: compression::CompressionProgram = match &compression::COMPRESSION_PROGRAMS[compression_type.clone()] {
|
||||||
CompressionType::None => compression::CompressionProgram {
|
Some(compression_program) => compression_program.clone(),
|
||||||
|
None => compression::CompressionProgram {
|
||||||
program: "".to_string(),
|
program: "".to_string(),
|
||||||
compress: Vec::new(),
|
compress: Vec::new(),
|
||||||
decompress: Vec::new(),
|
decompress: Vec::new(),
|
||||||
supported: true
|
supported: true
|
||||||
},
|
}
|
||||||
_ => compression::get_program(compression_type.clone())?
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let is_default = compression_type == default_type;
|
let is_default = compression_type == default_type;
|
||||||
@@ -672,7 +672,10 @@ fn mode_status(_cmd: &mut Command, args: Args, data_path: PathBuf, db_path: Path
|
|||||||
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
|
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
|
||||||
false => Cell::new("No")
|
false => Cell::new("No")
|
||||||
},
|
},
|
||||||
Cell::new(&compression_program.program),
|
match compression_program.program.eq("") {
|
||||||
|
true => Cell::new("<INTERNAL>").with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
||||||
|
false => Cell::new(&compression_program.program),
|
||||||
|
},
|
||||||
Cell::new(&compression_program.compress.join(" ")),
|
Cell::new(&compression_program.compress.join(" ")),
|
||||||
Cell::new(&compression_program.decompress.join(" ")),
|
Cell::new(&compression_program.decompress.join(" ")),
|
||||||
]));
|
]));
|
||||||
|
|||||||
Reference in New Issue
Block a user