From 7932a2d4b64c08f910b4571604909e111001a5fe Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Thu, 5 Dec 2024 12:56:13 +0800 Subject: [PATCH 1/4] process: add `Command::into_std()` Fixes: #7001 --- tokio/src/process/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index bd4a7ecee7b..c4114699bec 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -330,6 +330,11 @@ impl Command { &mut self.std } + /// Cheaply convert into a `std::process::Command`. + pub fn into_std(self) -> StdCommand { + self.std + } + /// Adds an argument to pass to the program. /// /// Only one argument can be passed per use. So instead of: From 2ed3906f5d82e68aec7d70cf1bfce76511e1444c Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Thu, 5 Dec 2024 17:37:42 +0800 Subject: [PATCH 2/4] update doc comment --- tokio/src/process/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index c4114699bec..653e438b9c3 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -331,6 +331,9 @@ impl Command { } /// Cheaply convert into a `std::process::Command`. + /// + /// Note that Tokio specific options (currently only option [kill_on_drop](Command::kill_on_drop)) + /// will be lost. pub fn into_std(self) -> StdCommand { self.std } From 6dd48468d42317c468931df85cd29401e4e557fb Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Thu, 5 Dec 2024 17:54:45 +0800 Subject: [PATCH 3/4] enclose method name in backticks to make spellcheck happy --- tokio/src/process/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index 653e438b9c3..8c4fe8025aa 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -332,7 +332,7 @@ impl Command { /// Cheaply convert into a `std::process::Command`. /// - /// Note that Tokio specific options (currently only option [kill_on_drop](Command::kill_on_drop)) + /// Note that Tokio specific options (currently only option [`kill_on_drop`](Command::kill_on_drop)) /// will be lost. pub fn into_std(self) -> StdCommand { self.std From e2edb31e65f5ed11d0db71d583c2d7fab0b3cb92 Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Sat, 7 Dec 2024 12:06:34 +0800 Subject: [PATCH 4/4] update doc comment Co-authored-by: Alice Ryhl --- tokio/src/process/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index 8c4fe8025aa..8ca4818362a 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -332,8 +332,9 @@ impl Command { /// Cheaply convert into a `std::process::Command`. /// - /// Note that Tokio specific options (currently only option [`kill_on_drop`](Command::kill_on_drop)) - /// will be lost. + /// Note that Tokio specific options will be lost. Currently, this only applies to [`kill_on_drop`]. + /// + /// [`kill_on_drop`]: Command::kill_on_drop pub fn into_std(self) -> StdCommand { self.std }