From 9cd02e476f727cbae10fa74d698416fbe9a716fd Mon Sep 17 00:00:00 2001 From: Fenhl Date: Fri, 30 Aug 2019 13:06:34 +0000 Subject: [PATCH] tokio-process: Implement From for Command This allows the usage of `std::os::{unix,windows}::process::CommandExt`, which can't be implemented on `tokio_process::Command` since their methods have `&mut StdCommand` return types. --- tokio-net/src/process/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio-net/src/process/mod.rs b/tokio-net/src/process/mod.rs index e1e6cce8493..7de1064ea2b 100644 --- a/tokio-net/src/process/mod.rs +++ b/tokio-net/src/process/mod.rs @@ -571,6 +571,12 @@ impl Command { } } +impl From for Command { + fn from(std: StdCommand) -> Command { + Command { std } + } +} + /// A drop guard which ensures the child process is killed on drop to maintain /// the contract of dropping a Future leads to "cancellation". #[derive(Debug)]