]> git.lizzy.rs Git - rust.git/commit
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)
commit0547a407aa03b9f1c03843aead617a2e8c5d1147
tree28ac3a579cf0bf5da2fd1521c2ac5544bfa5f464
parent51a25c7f96ad0d00836314d705e3f0a477562a2c
parentdd9dda7a1c87170fe241345f6da88874921ec433
auto merge of #18457 : japaric/rust/tocstr, r=alexcrichton

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