diff options
| author | bors <bors@rust-lang.org> | 2014-07-10 09:16:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-10 09:16:29 +0000 |
| commit | f8658124512bd06398908f989c9cc9fa05cf43f0 (patch) | |
| tree | 9c2cc1f0b2a53f3c569bf6f973dc74fe03154575 /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | 6372915a78a12adfbc327aba87225988ae03e7f9 (diff) | |
| parent | 6d50828fdbf6eed62a8f22a52d81ecb4c5e98690 (diff) | |
| download | rust-f8658124512bd06398908f989c9cc9fa05cf43f0.tar.gz rust-f8658124512bd06398908f989c9cc9fa05cf43f0.zip | |
auto merge of #15566 : japaric/rust/command-clone, r=alexcrichton
Allows use cases like this one:
``` rust
use std::io::Command;
fn main() {
let mut cmd = Command::new("ls");
cmd.arg("-l");
for &dir in ["a", "b", "c"].iter() {
println!("{}", cmd.clone().arg(dir));
}
}
```
Output:
```
ls '-l' 'a'
ls '-l' 'b'
ls '-l' 'c'
```
Without the `clone()`, you'll end up with:
```
ls '-l' 'a'
ls '-l' 'a' 'b'
ls '-l' 'a' 'b' 'c'
```
cc #15294
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
