about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-07-10 09:16:29 +0000
committerbors <bors@rust-lang.org>2014-07-10 09:16:29 +0000
commitf8658124512bd06398908f989c9cc9fa05cf43f0 (patch)
tree9c2cc1f0b2a53f3c569bf6f973dc74fe03154575 /src/rustllvm/RustWrapper.cpp
parent6372915a78a12adfbc327aba87225988ae03e7f9 (diff)
parent6d50828fdbf6eed62a8f22a52d81ecb4c5e98690 (diff)
downloadrust-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/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions