diff options
| author | Steven Fackler <sfackler@gmail.com> | 2014-03-26 09:24:16 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2014-04-06 15:39:56 -0700 |
| commit | d0e60b72ee3f5fb07b01143d82362cb42307f32d (patch) | |
| tree | ed0161843da862f7b40a01b76a81ced97c1e67da /src/libworkcache | |
| parent | 94a055c7295bd5822219b86243c2af6fff9d21d3 (diff) | |
| download | rust-d0e60b72ee3f5fb07b01143d82362cb42307f32d.tar.gz rust-d0e60b72ee3f5fb07b01143d82362cb42307f32d.zip | |
De-~[] Reader and Writer
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
Diffstat (limited to 'src/libworkcache')
| -rw-r--r-- | src/libworkcache/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs index 6c1a52f4eee..8883abffb93 100644 --- a/src/libworkcache/lib.rs +++ b/src/libworkcache/lib.rs @@ -479,7 +479,7 @@ impl<'a, T:Send + fn test() { use std::os; use std::io::{fs, Process}; - use std::str::from_utf8_owned; + use std::str::from_utf8; // Create a path to a new file 'filename' in the directory in which // this test is running. @@ -505,7 +505,7 @@ fn test() { let pth = pth.clone(); let contents = File::open(&pth).read_to_end().unwrap(); - let file_content = from_utf8_owned(contents).unwrap(); + let file_content = from_utf8(contents.as_slice()).unwrap().to_owned(); // FIXME (#9639): This needs to handle non-utf8 paths prep.declare_input("file", pth.as_str().unwrap(), file_content); |
