1.20.0[−][src]Function sp_std::str::from_boxed_utf8_unchecked
pub unsafe fn from_boxed_utf8_unchecked(v: Box<[u8]>) -> Box<str>ⓘImportant traits for Box<R>
impl<R> Read for Box<R> where
R: Read + ?Sized, impl<W> Write for Box<W> where
W: Write + ?Sized, impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F> Future for Box<F> where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;
Converts a boxed slice of bytes to a boxed string slice without checking that the string contains valid UTF-8.
Examples
Basic usage:
let smile_utf8 = Box::new([226, 152, 186]); let smile = unsafe { std::str::from_boxed_utf8_unchecked(smile_utf8) }; assert_eq!("☺", &*smile);