]> git.proxmox.com Git - cargo.git/commitdiff
Allow to substitute executed program in `ProcessBuilder`
authorIgor Matuszewski <Xanewok@gmail.com>
Sun, 27 Aug 2017 16:02:05 +0000 (18:02 +0200)
committerIgor Matuszewski <Xanewok@gmail.com>
Sun, 27 Aug 2017 16:45:49 +0000 (18:45 +0200)
src/cargo/util/process_builder.rs

index 704275d8c4b0c0d63f797b8e7a68ec62d8799571..4cb3f88c67f9e41c50bbbb187da3a48cbe641b66 100644 (file)
@@ -33,6 +33,11 @@ impl fmt::Display for ProcessBuilder {
 }
 
 impl ProcessBuilder {
+    pub fn program<T: AsRef<OsStr>>(&mut self, program: T) -> &mut ProcessBuilder {
+        self.program = program.as_ref().to_os_string();
+        self
+    }
+
     pub fn arg<T: AsRef<OsStr>>(&mut self, arg: T) -> &mut ProcessBuilder {
         self.args.push(arg.as_ref().to_os_string());
         self