From 9d64e46013096997627da62ecc65225bc22682e8 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Thu, 28 Nov 2013 23:52:11 +1100 Subject: 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. --- src/libstd/num/strconv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/num') 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 (~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, -- cgit 1.4.1-3-g733a5