From 8fca6f6dad209b9f6200202d8a46a9769f796ce7 Mon Sep 17 00:00:00 2001 From: Timo <39920115+tglane@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:34:22 +0200 Subject: [PATCH] process: add `Command::as_std_mut` (#6608) --- tokio/src/process/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index 585dbdd6a..fc768809f 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -325,6 +325,12 @@ impl Command { &self.std } + /// Cheaply convert to a `&mut std::process::Command` for places where the type from the + /// standard library is expected. + pub fn as_std_mut(&mut self) -> &mut StdCommand { + &mut self.std + } + /// Adds an argument to pass to the program. /// /// Only one argument can be passed per use. So instead of: