about summary refs log tree commit diff
path: root/src/libextra/workcache.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-11-28 23:52:11 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-12-04 22:35:53 +1100
commit9d64e46013096997627da62ecc65225bc22682e8 (patch)
treefa20c8fd1d653acff5f996253d16103dd61addd9 /src/libextra/workcache.rs
parent9635c763ba5edc8c8ea2868b895548b52f640e5a (diff)
downloadrust-9d64e46013096997627da62ecc65225bc22682e8.tar.gz
rust-9d64e46013096997627da62ecc65225bc22682e8.zip
std::str: remove from_utf8.
This function had type &[u8] -> ~str, i.e. it allocates a string
internally, even though the non-allocating version that take &[u8] ->
&str and ~[u8] -> ~str are all that is necessary in most circumstances.
Diffstat (limited to 'src/libextra/workcache.rs')
-rw-r--r--src/libextra/workcache.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs
index ab36defe522..d906896ff60 100644
--- a/src/libextra/workcache.rs
+++ b/src/libextra/workcache.rs
@@ -260,7 +260,7 @@ fn json_encode<'self, T:Encodable<json::Encoder<'self>>>(t: &T) -> ~str {
     let mut writer = MemWriter::new();
     let mut encoder = json::Encoder::init(&mut writer as &mut io::Writer);
     t.encode(&mut encoder);
-    str::from_utf8(writer.inner_ref().as_slice())
+    str::from_utf8_owned(writer.inner())
 }
 
 // FIXME(#5121)