]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #18457 : japaric/rust/tocstr, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 1 Nov 2014 11:21:47 +0000 (11:21 +0000)
committerbors <bors@rust-lang.org>
Sat, 1 Nov 2014 11:21:47 +0000 (11:21 +0000)
Methods that used to take `ToCStr` implementors by value, now take them by reference. In particular, this breaks some uses of `Command`:

``` rust
Command::new("foo");  // Still works
Command::new(path) -> Command::new(&path)
cmd.arg(string) -> cmd.arg(&string) or cmd.arg(string.as_slice())
```

[breaking-change]

---

It may be sensible to remove `impl ToCstr for String` since:
- We're getting `impl Deref<str> for String`, so `string.to_cstr()` would still work
- `Command` methods would still be able to use `cmd.arg(string[..])` instead of `cmd.arg(&string)`.

But, I'm leaving that up to the library stabilization process.

r? @aturon
cc #16918


Trivial merge