projects
/
cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bcf3997
)
Add `fn args_replace` and `fn get_program` to `ProcessBuilder`
author
Igor Matuszewski
<Xanewok@gmail.com>
Tue, 22 Aug 2017 15:13:00 +0000
(17:13 +0200)
committer
Igor Matuszewski
<Xanewok@gmail.com>
Tue, 22 Aug 2017 15:13:15 +0000
(17:13 +0200)
src/cargo/util/process_builder.rs
patch
|
blob
|
history
diff --git
a/src/cargo/util/process_builder.rs
b/src/cargo/util/process_builder.rs
index 6386be9de3e22c7726f123ca11c0352b1c2466b0..704275d8c4b0c0d63f797b8e7a68ec62d8799571 100644
(file)
--- a/
src/cargo/util/process_builder.rs
+++ b/
src/cargo/util/process_builder.rs
@@
-45,6
+45,13
@@
impl ProcessBuilder {
self
}
+ pub fn args_replace<T: AsRef<OsStr>>(&mut self, arguments: &[T]) -> &mut ProcessBuilder {
+ self.args = arguments.iter().map(|t| {
+ t.as_ref().to_os_string()
+ }).collect();
+ self
+ }
+
pub fn cwd<T: AsRef<OsStr>>(&mut self, path: T) -> &mut ProcessBuilder {
self.cwd = Some(path.as_ref().to_os_string());
self
@@
-61,6
+68,10
@@
impl ProcessBuilder {
self
}
+ pub fn get_program(&self) -> &OsString {
+ &self.program
+ }
+
pub fn get_args(&self) -> &[OsString] {
&self.args
}