]> git.lizzy.rs Git - rust.git/commitdiff
Deprecated `str::raw::from_byte`
authorAdolfo OchagavĂ­a <aochagavia92@gmail.com>
Sat, 19 Jul 2014 10:30:35 +0000 (12:30 +0200)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 24 Jul 2014 14:25:43 +0000 (07:25 -0700)
Use `string:raw::from_utf8` instead

[breaking-change]

src/libcollections/str.rs

index 05107f5dda53a66f58b05651f8ec814eae7230c4..e83e617dba7ff53b0b44a1065d457eb463d3b5ba 100644 (file)
@@ -598,9 +598,10 @@ pub unsafe fn from_utf8_owned(v: Vec<u8>) -> String {
         string::raw::from_utf8(v)
     }
 
-    /// Converts a byte to a string.
+    /// Deprecated. Use `String::from_bytes`
+    #[deprecated = "Use String::from_bytes"]
     pub unsafe fn from_byte(u: u8) -> String {
-        from_utf8_owned(vec![u])
+        String::from_bytes(vec![u])
     }
 
     #[test]