From dc16b12edb77d4710c92352492826fd0db01cbc1 Mon Sep 17 00:00:00 2001 From: 29 <791603901@qq.com> Date: Sat, 7 Dec 2024 19:56:02 +0800 Subject: [PATCH] process: add `Command::into_std()` (#7014) --- tokio/src/process/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index bd4a7ecee..8ca481836 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -330,6 +330,15 @@ impl Command { &mut self.std } + /// Cheaply convert into a `std::process::Command`. + /// + /// 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 + } + /// Adds an argument to pass to the program. /// /// Only one argument can be passed per use. So instead of: