about summary refs log tree commit diff
path: root/src/libstd/num
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/libstd/num
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/libstd/num')
-rw-r--r--src/libstd/num/strconv.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index 1028cef9dc6..8e678ab66b2 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -426,7 +426,7 @@ pub fn float_to_str_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Float+Round+
         sign: SignFormat, digits: SignificantDigits) -> (~str, bool) {
     let (bytes, special) = float_to_str_bytes_common(num, radix,
                                negative_zero, sign, digits);
-    (str::from_utf8(bytes), special)
+    (str::from_utf8_owned(bytes), special)
 }
 
 // Some constants for from_str_bytes_common's input validation,