inline some common methods on OsStr
This commit is contained in:
parent
14195e1f1d
commit
bf1f1c242c
3 changed files with 11 additions and 0 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue