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 program: String,
|
||||||
pub args: Vec<String>,
|
pub args: Vec<String>,
|
||||||
pub supported: bool,
|
pub supported: bool,
|
||||||
pub stdin: Option<tokio::io::BufWriter<std::process::ChildStdin>>,
|
process: Option<std::process::Child>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DigestEngineProgram {
|
impl DigestEngineProgram {
|
||||||
pub fn new(program: &str, args: Vec<&str>) -> DigestEngineProgram {
|
pub fn new(program: &str, args: Vec<&str>) -> DigestEngineProgram {
|
||||||
let program_path = get_program_path(program);
|
let program_path = get_program_path(program);
|
||||||
let supported = program_path.is_ok();
|
let supported = program_path.is_ok();
|
||||||
|
|
||||||
DigestEngineProgram {
|
DigestEngineProgram {
|
||||||
program: program_path.unwrap_or(program.to_string()),
|
program: program_path.unwrap_or(program.to_string()),
|
||||||
args: args.iter().map(|s| s.to_string()).collect(),
|
args: args.iter().map(|s| s.to_string()).collect(),
|
||||||
supported,
|
supported,
|
||||||
stdin: None,
|
process: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user