From d554ce591fb4677a876c7e420cba79592fe2cfb1 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Sun, 27 Aug 2017 18:02:05 +0200 Subject: [PATCH] Allow to substitute executed program in `ProcessBuilder` --- src/cargo/util/process_builder.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cargo/util/process_builder.rs b/src/cargo/util/process_builder.rs index 704275d8c..4cb3f88c6 100644 --- a/src/cargo/util/process_builder.rs +++ b/src/cargo/util/process_builder.rs @@ -33,6 +33,11 @@ impl fmt::Display for ProcessBuilder { } impl ProcessBuilder { + pub fn program>(&mut self, program: T) -> &mut ProcessBuilder { + self.program = program.as_ref().to_os_string(); + self + } + pub fn arg>(&mut self, arg: T) -> &mut ProcessBuilder { self.args.push(arg.as_ref().to_os_string()); self -- 2.39.5