pub fn from_utf8_opt<'a>(v: &'a [u8]) -> Option<&'a str> {
    if is_utf8(v) {
        Some(unsafe { raw::from_utf8(v) })
    } else { None }
}
/// Converts a vector to a string slice without performing any allocations.
///
/// Returns None if the slice is not utf-8.
Converts a vector to a string slice without performing any allocations.
Returns None if the slice is not utf-8.
Converts a vector to a string slice without performing any allocations . Returns None if the slice is not utf - 8 .
pub fn from_utf8_opt<'a>(v: &'a [u8]) -> Option<&'a str> {
    if is_utf8(v) {
        Some(unsafe { raw::from_utf8(v) })
    } else { None }
}
pub fn from_utf8_opt < ' a > ( v : & ' a [ u8 ] ) -> Option < & ' a str > { if is_utf8 ( v ) { Some ( unsafe { raw :: from_utf8 ( v ) } ) } else { None } }
Converts a vector to a string slice without performing any allocations.
Converts a vector to a string slice without performing any allocations .
v
&'a [u8]
v
&'a [u8]