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:
@@ -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)?))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user