refactor: Use is_internal instead of comparing against empty string for compression engine
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -74,8 +74,18 @@ pub fn generate_status_info(
|
|||||||
|
|
||||||
for compression_type in sorted_compression_types {
|
for compression_type in sorted_compression_types {
|
||||||
let (binary, compress, decompress, supported) = match get_compression_engine(compression_type.clone()) {
|
let (binary, compress, decompress, supported) = match get_compression_engine(compression_type.clone()) {
|
||||||
Ok(engine) if engine.is_supported() => engine.get_status_info(),
|
Ok(engine) => {
|
||||||
_ => ("<UNSUPPORTED>".to_string(), "".to_string(), "".to_string(), false),
|
let supp = engine.is_supported();
|
||||||
|
if supp && engine.is_internal() {
|
||||||
|
("<INTERNAL>".to_string(), "".to_string(), "".to_string(), supp)
|
||||||
|
} else if supp {
|
||||||
|
let (b, c, d) = engine.get_status_info();
|
||||||
|
(b, c, d, supp)
|
||||||
|
} else {
|
||||||
|
("<UNSUPPORTED>".to_string(), "".to_string(), "".to_string(), supp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(_) => ("<UNSUPPORTED>".to_string(), "".to_string(), "".to_string(), false),
|
||||||
};
|
};
|
||||||
|
|
||||||
let is_enabled = enabled_compression_type.as_ref().map_or(false, |ct| *ct == compression_type);
|
let is_enabled = enabled_compression_type.as_ref().map_or(false, |ct| *ct == compression_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user