Skip to content

Commit feeae27

Browse files
aochagaviaalexcrichton
authored andcommitted
Deprecated str::raw::from_byte
Use `string:raw::from_utf8` instead [breaking-change]
1 parent 9ec1937 commit feeae27

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libcollections/str.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,10 @@ pub mod raw {
598598
string::raw::from_utf8(v)
599599
}
600600

601-
/// Converts a byte to a string.
601+
/// Deprecated. Use `String::from_bytes`
602+
#[deprecated = "Use String::from_bytes"]
602603
pub unsafe fn from_byte(u: u8) -> String {
603-
from_utf8_owned(vec![u])
604+
String::from_bytes(vec![u])
604605
}
605606

606607
#[test]

0 commit comments

Comments
 (0)