refactor: Replace stdin field with process field in DigestEngineProgram
This commit is contained in:
@@ -16,18 +16,19 @@ pub struct DigestEngineProgram {
|
||||
pub program: String,
|
||||
pub args: Vec<String>,
|
||||
pub supported: bool,
|
||||
pub stdin: Option<tokio::io::BufWriter<std::process::ChildStdin>>,
|
||||
process: Option<std::process::Child>,
|
||||
}
|
||||
|
||||
impl DigestEngineProgram {
|
||||
pub fn new(program: &str, args: Vec<&str>) -> DigestEngineProgram {
|
||||
let program_path = get_program_path(program);
|
||||
let supported = program_path.is_ok();
|
||||
|
||||
DigestEngineProgram {
|
||||
program: program_path.unwrap_or(program.to_string()),
|
||||
args: args.iter().map(|s| s.to_string()).collect(),
|
||||
supported,
|
||||
stdin: None,
|
||||
process: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user