From b2988a997586c32efa4a61f28d2d6dbd9c90b879 Mon Sep 17 00:00:00 2001 From: juice094 <160722440+juice094@users.noreply.github.com> Date: Fri, 15 May 2026 11:56:42 +0800 Subject: [PATCH] refactor(executor): merge redundant #[cfg] branches for wait_with_timeout Windows and Unix implementations were byte-for-byte identical. Remove the platform-specific duplication and keep a single cross-platform function. --- src/skill_runtime/executor.rs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/skill_runtime/executor.rs b/src/skill_runtime/executor.rs index 820c45c..0e5fe87 100644 --- a/src/skill_runtime/executor.rs +++ b/src/skill_runtime/executor.rs @@ -413,26 +413,6 @@ fn devbase_home() -> anyhow::Result { Ok(path.to_string_lossy().to_string()) } -#[cfg(windows)] -fn wait_with_timeout( - child: &mut std::process::Child, - timeout: Duration, -) -> anyhow::Result> { - let start = Instant::now(); - loop { - match child.try_wait()? { - Some(status) => return Ok(Some(status)), - None => { - if start.elapsed() >= timeout { - return Ok(None); - } - std::thread::sleep(Duration::from_millis(50)); - } - } - } -} - -#[cfg(unix)] fn wait_with_timeout( child: &mut std::process::Child, timeout: Duration,