From b32b0eaedc16fd857e706bba3a61368a6024933a Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Sat, 4 Mar 2023 13:38:32 +0100 Subject: [PATCH] Emit Errors in CommandRunner --- src/command_runner.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/command_runner.rs b/src/command_runner.rs index cca8207..70418d8 100644 --- a/src/command_runner.rs +++ b/src/command_runner.rs @@ -63,13 +63,9 @@ impl CommandRunner for StdCommandRunner { .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::piped()) - .spawn() - .expect("Failed to spawn child process"); + .spawn()?; let stdin = child.stdin.as_mut().expect("Failed to open stdin"); - stdin - .write_all(input) - .await - .expect("Failed to write to stdin"); + stdin.write_all(input).await?; let res = child.wait_with_output().await; //println!("{:?}", res); #[allow(clippy::let_and_return)]