From b172ba7f03577483f43ca0edccc0226e16a3a26f Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Wed, 11 Dec 2024 08:59:19 +0800 Subject: [PATCH] fix: Executor::spawn()/output() should not use their _checked() variants --- src/executor.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/executor.rs b/src/executor.rs index 7df3e719..0a99b267 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -152,7 +152,10 @@ impl Executor { let result = match self { Executor::Wet(c) => { debug!("Running {:?}", c); - c.spawn_checked().map(ExecutorChild::Wet)? + // We should use `spawn()` here rather than `spawn_checked()` since + // their semantics and behaviors are different. + #[allow(clippy::disallowed_methods)] + c.spawn().map(ExecutorChild::Wet)? } Executor::Dry(c) => { c.dry_run(); @@ -166,7 +169,12 @@ impl Executor { /// See `std::process::Command::output` pub fn output(&mut self) -> Result { match self { - Executor::Wet(c) => Ok(ExecutorOutput::Wet(c.output_checked()?)), + Executor::Wet(c) => { + // We should use `output()` here rather than `output_checked()` since + // their semantics and behaviors are different. + #[allow(clippy::disallowed_methods)] + Ok(ExecutorOutput::Wet(c.output()?)) + } Executor::Dry(c) => { c.dry_run(); Ok(ExecutorOutput::Dry)