From d0e60b72ee3f5fb07b01143d82362cb42307f32d Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 26 Mar 2014 09:24:16 -0700 Subject: De-~[] Reader and Writer There's a little more allocation here and there now since from_utf8_owned can't be used with Vec. --- src/libworkcache/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libworkcache') 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); -- cgit 1.4.1-3-g733a5