about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-03 12:12:24 +0000
committerbors <bors@rust-lang.org>2014-11-03 12:12:24 +0000
commitb9b396cd7506c2e2aa6737adfa80f3404ed81b9d (patch)
treee623507b5799ba153b33c059e6b15a15cd5806ac /src/libstd/io
parent851799d09e48e06f3fd0c4c6f694af51fc655f9a (diff)
parentfe256f81401e7af5fb3a3ec069427fd9c52073a9 (diff)
downloadrust-b9b396cd7506c2e2aa6737adfa80f3404ed81b9d.tar.gz
rust-b9b396cd7506c2e2aa6737adfa80f3404ed81b9d.zip
auto merge of #18463 : japaric/rust/bytes2, r=alexcrichton
- The `BytesContainer::container_into_owned_bytes` method has been removed

- Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path:

``` rust
Path::new("foo")  // Still works
path.join(another_path) -> path.join(&another_path)
```

[breaking-change]

---

Re: `container_into_owned_bytes`, I've removed it because

- Nothing in the whole repository uses it
- Takes `self` by value, which is incompatible with unsized types (`str`)

The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method.

Re: Breakage of `Path` methods

We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code.

r? @aturon 
cc #16918
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/process.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs
index 4e5f8822acb..312a4c41ac9 100644
--- a/src/libstd/io/process.rs
+++ b/src/libstd/io/process.rs
@@ -918,7 +918,7 @@ mod tests {
         let prog = pwd_cmd().cwd(&parent_dir).spawn().unwrap();
 
         let output = String::from_utf8(prog.wait_with_output().unwrap().output).unwrap();
-        let child_dir = Path::new(output.as_slice().trim().into_string());
+        let child_dir = Path::new(output.as_slice().trim());
 
         let parent_stat = parent_dir.stat().unwrap();
         let child_stat = child_dir.stat().unwrap();