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:
Andrew Phillips
2025-09-11 10:58:19 -03:00
parent 08b5f284d3
commit f2d340e778

View File

@@ -74,8 +74,18 @@ pub fn generate_status_info(
for compression_type in sorted_compression_types {
let (binary, compress, decompress, supported) = match get_compression_engine(compression_type.clone()) {
Ok(engine) if engine.is_supported() => engine.get_status_info(),
_ => ("<UNSUPPORTED>".to_string(), "".to_string(), "".to_string(), false),
Ok(engine) => {
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);