about summary refs log tree commit diff
path: root/src/libextra/workcache.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-04 11:32:23 -0800
committerbors <bors@rust-lang.org>2013-12-04 11:32:23 -0800
commit9b9cf9892b74dc376fe740ea56858042e9bd89de (patch)
tree0453cef98715b1efed5b3baed3d0481eb474f09c /src/libextra/workcache.rs
parent5fa6bd526ef66ce9ce80e975340aa98bcc3596b7 (diff)
parentb0426edc0a83699de79ceffcbe603812b9b53374 (diff)
downloadrust-9b9cf9892b74dc376fe740ea56858042e9bd89de.tar.gz
rust-9b9cf9892b74dc376fe740ea56858042e9bd89de.zip
auto merge of #10701 : huonw/rust/rm-from_utf8, r=brson
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)