fix: fix typos and improve error handling in compression engines
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -83,7 +83,9 @@ impl<W: Write> Drop for AutoFinishGzEncoder<W> {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Some(encoder) = self.encoder.take() {
|
if let Some(encoder) = self.encoder.take() {
|
||||||
debug!("COMPRESSION: Finishing");
|
debug!("COMPRESSION: Finishing");
|
||||||
let _ = encoder.finish();
|
if let Err(e) = encoder.finish() {
|
||||||
|
warn!("Failed to finish GZip encoder: {}", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ impl CompressionEngine for CompressionEngineLZ4 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn create(&self, file_path: PathBuf) -> Result<Box<dyn Write>> {
|
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);
|
||||||
|
|
||||||
let file = File::create(file_path)?;
|
let file = File::create(file_path)?;
|
||||||
let lz4_write = FrameEncoder::new(file).auto_finish();
|
let lz4_write = FrameEncoder::new(file).auto_finish();
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
/// differences using external diff tools.
|
/// differences using external diff tools.
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use clap::Command;
|
use clap::Command;
|
||||||
use std::io::Read;
|
|
||||||
use std::os::fd::FromRawFd;
|
|
||||||
use crate::config;
|
use crate::config;
|
||||||
use crate::services::item_service::ItemService;
|
use crate::services::item_service::ItemService;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|||||||
Reference in New Issue
Block a user