fix: resolve compilation errors and warnings in keep crate

Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-07-29 15:37:43 -03:00
parent 8814d02264
commit 3008f3fec0
4 changed files with 25 additions and 9 deletions

View File

@@ -36,6 +36,24 @@ impl CompressionEngineProgram {
}
}
fn get_program_path(program: &str) -> Result<String> {
debug!("COMPRESSION: Looking for executable: {}", program);
if let Ok(path) = env::var("PATH") {
for p in path.split(':') {
let p_str = format!("{}/{}", p, program);
let stat = fs::metadata(p_str.clone());
if let Ok(stat) = stat {
let md = stat;
let permissions = md.permissions();
if md.is_file() && permissions.mode() & 0o111 != 0 {
return Ok(p_str);
}
}
}
}
Err(anyhow!("Unable to find binary {} in PATH", program))
}
impl CompressionEngine for CompressionEngineProgram {
fn is_supported(&self) -> bool {
self.supported