refactor: Improve compression status and engine selection logic

Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-11 10:54:40 -03:00
parent a20f651c01
commit f1f60f7178
4 changed files with 38 additions and 205 deletions

View File

@@ -16,6 +16,14 @@ impl CompressionEngineNone {
}
impl CompressionEngine for CompressionEngineNone {
fn is_supported(&self) -> bool {
true
}
fn get_status_info(&self) -> (String, String, String) {
("<INTERNAL>".to_string(), "".to_string(), "".to_string())
}
fn size(&self, file_path: PathBuf) -> Result<usize> {
let item_file_metadata = file_path.metadata()?;
Ok(item_file_metadata.len() as usize)
@@ -27,7 +35,7 @@ impl CompressionEngine for CompressionEngineNone {
}
fn create(&self, file_path: PathBuf) -> Result<Box<dyn Write>> {
debug!("COMPRESSION: Writting to {:?} using {:?}", file_path, *self);
debug!("COMPRESSION: Writing to {:?} using {:?}", file_path, *self);
Ok(Box::new(File::create(file_path)?))
}
}