2017-12-21 12:32:14 +00:00
|
|
|
#[cfg(not(feature = "no-unsafe"))]
|
|
|
|
pub fn from_utf8_unchecked(v: &[u8]) -> &str {
|
2020-03-07 15:57:47 +00:00
|
|
|
unsafe { ::std::str::from_utf8_unchecked(v) }
|
2017-12-21 12:32:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "no-unsafe")]
|
|
|
|
pub fn from_utf8_unchecked(v: &[u8]) -> &str {
|
|
|
|
::std::str::from_utf8(v).expect("from_utf8_unchecked")
|
|
|
|
}
|