Skip to content

Commit b889445

Browse files
authored
Fix run_output
1 parent b0ba909 commit b889445

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/command_helpers.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,15 @@ pub(crate) fn run_output(cmd: &mut Command, cargo_output: &CargoOutput) -> Resul
356356
status,
357357
stdout,
358358
stderr,
359-
} = spawn(cmd, &captured_cargo_output)?.wait_with_output()?;
359+
} = spawn(cmd, &captured_cargo_output)?
360+
.wait_with_output()
361+
.map_err(|e| Err(Error::new(
362+
ErrorKind::ToolExecError,
363+
format!("failed to wait on spawned child process `{cmd:?}`: {e}"),
364+
)))?;
360365

361366
stderr.split(|&b| b == b'\n').for_each(write_warning);
362367

363-
let status = match child.wait() {
364-
Ok(s) => s,
365-
Err(e) => {
366-
return Err(Error::new(
367-
ErrorKind::ToolExecError,
368-
format!("failed to wait on spawned child process `{cmd:?}`: {e}"),
369-
));
370-
}
371-
};
372-
373368
cargo_output.print_debug(&status);
374369

375370
if status.success() {

0 commit comments

Comments
 (0)