From db03f63e76b5b32f65d34a1bd08ae56dab595f60 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira <118899497+lucasfernog-crabnebula@users.noreply.github.com> Date: Sat, 7 Jun 2025 11:59:15 -0300 Subject: [PATCH] allow using a TokioCommandWrap for TokioChildProcess::new closes #243 (#245) * allow using a TokioCommandWrap for TokioChildProcess::new closes #243 TokioCommandWrap implements From so this is not a breaking change, but also downstream users have more control over flags such as KillOnDrop and CreationFlags see https://docs.rs/process-wrap/latest/process_wrap/#killondrop-and-creationflags --- crates/rmcp/src/transport/child_process.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/rmcp/src/transport/child_process.rs b/crates/rmcp/src/transport/child_process.rs index f2e3c66..7295779 100644 --- a/crates/rmcp/src/transport/child_process.rs +++ b/crates/rmcp/src/transport/child_process.rs @@ -59,11 +59,12 @@ impl AsyncRead for TokioChildProcessOut { } impl TokioChildProcess { - pub fn new(mut command: tokio::process::Command) -> std::io::Result { - command + pub fn new(command: impl Into) -> std::io::Result { + let mut command_wrap = command.into(); + command_wrap + .command_mut() .stdin(std::process::Stdio::piped()) .stdout(std::process::Stdio::piped()); - let mut command_wrap = TokioCommandWrap::from(command); #[cfg(unix)] command_wrap.wrap(process_wrap::tokio::ProcessGroup::leader()); #[cfg(windows)]