Skip to content

Commit d7a05aa

Browse files
authored
fix: update process-wrap to v9.0 (#586)
1 parent f20ed20 commit d7a05aa

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

crates/rmcp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ url = { version = "2.4", optional = true }
4848
tower-service = { version = "0.3", optional = true }
4949

5050
# for child process transport
51-
process-wrap = { version = "8.2", features = ["tokio1"], optional = true }
51+
process-wrap = { version = "9.0", features = ["tokio1"], optional = true }
5252

5353
# for ws transport
5454
# tokio-tungstenite ={ version = "0.26", optional = true }

crates/rmcp/src/transport/child_process.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::process::Stdio;
22

33
use futures::future::Future;
4-
use process_wrap::tokio::{TokioChildWrapper, TokioCommandWrap};
4+
use process_wrap::tokio::{ChildWrapper, CommandWrap};
55
use tokio::{
66
io::AsyncRead,
77
process::{ChildStderr, ChildStdin, ChildStdout},
@@ -13,7 +13,7 @@ use crate::RoleClient;
1313
const MAX_WAIT_ON_DROP_SECS: u64 = 3;
1414
/// The parts of a child process.
1515
type ChildProcessParts = (
16-
Box<dyn TokioChildWrapper>,
16+
Box<dyn ChildWrapper>,
1717
ChildStdout,
1818
ChildStdin,
1919
Option<ChildStderr>,
@@ -23,7 +23,7 @@ type ChildProcessParts = (
2323
/// Returns `(child, stdout, stdin, stderr)` where `stderr` is `Some` only
2424
/// if the process was spawned with `Stdio::piped()`.
2525
#[inline]
26-
fn child_process(mut child: Box<dyn TokioChildWrapper>) -> std::io::Result<ChildProcessParts> {
26+
fn child_process(mut child: Box<dyn ChildWrapper>) -> std::io::Result<ChildProcessParts> {
2727
let child_stdin = match child.inner_mut().stdin().take() {
2828
Some(stdin) => stdin,
2929
None => return Err(std::io::Error::other("stdin was already taken")),
@@ -42,7 +42,7 @@ pub struct TokioChildProcess {
4242
}
4343

4444
pub struct ChildWithCleanup {
45-
inner: Option<Box<dyn TokioChildWrapper>>,
45+
inner: Option<Box<dyn ChildWrapper>>,
4646
}
4747

4848
impl Drop for ChildWithCleanup {
@@ -87,13 +87,13 @@ impl AsyncRead for TokioChildProcessOut {
8787

8888
impl TokioChildProcess {
8989
/// Convenience: spawn with default `piped` stdio
90-
pub fn new(command: impl Into<TokioCommandWrap>) -> std::io::Result<Self> {
90+
pub fn new(command: impl Into<CommandWrap>) -> std::io::Result<Self> {
9191
let (proc, _ignored) = TokioChildProcessBuilder::new(command).spawn()?;
9292
Ok(proc)
9393
}
9494

9595
/// Builder entry-point allowing fine-grained stdio control.
96-
pub fn builder(command: impl Into<TokioCommandWrap>) -> TokioChildProcessBuilder {
96+
pub fn builder(command: impl Into<CommandWrap>) -> TokioChildProcessBuilder {
9797
TokioChildProcessBuilder::new(command)
9898
}
9999

@@ -111,7 +111,7 @@ impl TokioChildProcess {
111111
if let Some(mut child) = self.child.inner.take() {
112112
self.transport.close().await?;
113113

114-
let wait_fut = Box::into_pin(child.wait());
114+
let wait_fut = child.wait();
115115
tokio::select! {
116116
_ = tokio::time::sleep(std::time::Duration::from_secs(MAX_WAIT_ON_DROP_SECS)) => {
117117
if let Err(e) = Box::into_pin(child.kill()).await {
@@ -136,7 +136,7 @@ impl TokioChildProcess {
136136
}
137137

138138
/// Take ownership of the inner child process
139-
pub fn into_inner(mut self) -> Option<Box<dyn TokioChildWrapper>> {
139+
pub fn into_inner(mut self) -> Option<Box<dyn ChildWrapper>> {
140140
self.child.inner.take()
141141
}
142142

@@ -152,14 +152,14 @@ impl TokioChildProcess {
152152

153153
/// Builder for `TokioChildProcess` allowing custom `Stdio` configuration.
154154
pub struct TokioChildProcessBuilder {
155-
cmd: TokioCommandWrap,
155+
cmd: CommandWrap,
156156
stdin: Stdio,
157157
stdout: Stdio,
158158
stderr: Stdio,
159159
}
160160

161161
impl TokioChildProcessBuilder {
162-
fn new(cmd: impl Into<TokioCommandWrap>) -> Self {
162+
fn new(cmd: impl Into<CommandWrap>) -> Self {
163163
Self {
164164
cmd: cmd.into(),
165165
stdin: Stdio::piped(),

0 commit comments

Comments
 (0)