refactor: add copy method to CompressionEngineProgram
This commit is contained in:
@@ -77,6 +77,13 @@ impl CompressionEngine for CompressionEngineProgram {
|
|||||||
|
|
||||||
Ok(Box::new(process.stdin.unwrap()))
|
Ok(Box::new(process.stdin.unwrap()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn copy(&self, file_path: PathBuf, writer: &mut dyn Write) -> Result<()> {
|
||||||
|
let mut reader = self.open(file_path)?;
|
||||||
|
io::copy(&mut reader, writer)?;
|
||||||
|
writer.flush()?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_program_path(program: &str) -> Result<String> {
|
fn get_program_path(program: &str) -> Result<String> {
|
||||||
|
|||||||
Reference in New Issue
Block a user