1
Fork 0

inline some common methods on OsStr

This commit is contained in:
Lzu Tao 2019-12-09 10:39:57 +00:00
parent 14195e1f1d
commit bf1f1c242c
3 changed files with 11 additions and 0 deletions

View file

@ -139,10 +139,12 @@ impl Buf {
}
impl Slice {
#[inline]
fn from_u8_slice(s: &[u8]) -> &Slice {
unsafe { mem::transmute(s) }
}
#[inline]
pub fn from_str(s: &str) -> &Slice {
Slice::from_u8_slice(s.as_bytes())
}