Ugh
This commit is contained in:
@@ -68,7 +68,8 @@ impl CompressionEngineProgram {
|
||||
let supported = program_path.is_ok();
|
||||
|
||||
CompressionEngineProgram {
|
||||
program: program_path.map_or_else(|_| program.to_string(), |p| p.to_string_lossy().to_string()),
|
||||
program: program_path
|
||||
.map_or_else(|_| program.to_string(), |p| p.to_string_lossy().to_string()),
|
||||
compress: compress.iter().map(|s| s.to_string()).collect(),
|
||||
decompress: decompress.iter().map(|s| s.to_string()).collect(),
|
||||
supported,
|
||||
@@ -117,9 +118,10 @@ impl CompressionEngine for CompressionEngineProgram {
|
||||
args
|
||||
))?;
|
||||
|
||||
let stdout = process.stdout.take().ok_or_else(|| {
|
||||
anyhow!("Failed to capture stdout from child process")
|
||||
})?;
|
||||
let stdout = process
|
||||
.stdout
|
||||
.take()
|
||||
.ok_or_else(|| anyhow!("Failed to capture stdout from child process"))?;
|
||||
|
||||
Ok(Box::new(ProgramReader {
|
||||
process,
|
||||
@@ -151,9 +153,10 @@ impl CompressionEngine for CompressionEngineProgram {
|
||||
args
|
||||
))?;
|
||||
|
||||
let stdin = process.stdin.take().ok_or_else(|| {
|
||||
anyhow!("Failed to capture stdin from child process")
|
||||
})?;
|
||||
let stdin = process
|
||||
.stdin
|
||||
.take()
|
||||
.ok_or_else(|| anyhow!("Failed to capture stdin from child process"))?;
|
||||
|
||||
Ok(Box::new(ProgramWriter {
|
||||
process,
|
||||
|
||||
Reference in New Issue
Block a user