From 012cc6dd04f18d960e952991c2db929f3b1ff72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Ochagav=C3=ADa?= Date: Tue, 28 Oct 2014 16:32:24 +0100 Subject: [PATCH] Remove unnecessary clone in ascii.rs --- src/libstd/ascii.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index c2e88bfdbcf..98445efafd2 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -330,8 +330,7 @@ impl IntoStr for Vec { #[inline] fn into_string(self) -> String { unsafe { - let s: &str = mem::transmute(self.as_slice()); - String::from_str(s) + string::raw::from_utf8(self.into_bytes()) } } }