[][src]Function alloc_wg::str::from_boxed_utf8_unchecked

pub unsafe fn from_boxed_utf8_unchecked<A: AllocRef>(
    v: Box<[u8], A>
) -> Box<str, A>

Notable traits for Box<I, A>

impl<I: Iterator + ?Sized, A: AllocRef> Iterator for Box<I, A> type Item = I::Item;impl<F: ?Sized + Future + Unpin, A: AllocRef> Future for Box<F, A> type Output = F::Output;

Converts a boxed slice of bytes to a boxed string slice without checking that the string contains valid UTF-8.

Examples

Basic usage:

use alloc_wg::boxed::Box;

let smile_utf8 = Box::new([226, 152, 186]);
let smile = unsafe { alloc_wg::str::from_boxed_utf8_unchecked(smile_utf8) };

assert_eq!("☺", &*smile);