Skip to content

Commit db03f63

Browse files
allow using a TokioCommandWrap for TokioChildProcess::new closes #243 (#245)
* allow using a TokioCommandWrap for TokioChildProcess::new closes #243 TokioCommandWrap implements From<tokio::process::Command> 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
1 parent 37b4ddb commit db03f63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/rmcp/src/transport/child_process.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ impl AsyncRead for TokioChildProcessOut {
5959
}
6060

6161
impl TokioChildProcess {
62-
pub fn new(mut command: tokio::process::Command) -> std::io::Result<Self> {
63-
command
62+
pub fn new(command: impl Into<TokioCommandWrap>) -> std::io::Result<Self> {
63+
let mut command_wrap = command.into();
64+
command_wrap
65+
.command_mut()
6466
.stdin(std::process::Stdio::piped())
6567
.stdout(std::process::Stdio::piped());
66-
let mut command_wrap = TokioCommandWrap::from(command);
6768
#[cfg(unix)]
6869
command_wrap.wrap(process_wrap::tokio::ProcessGroup::leader());
6970
#[cfg(windows)]

0 commit comments

Comments
 (0)