Mark unix::ffi::OsStrExt methods as inline
This commit is contained in:
parent
f717b58dd7
commit
a37c33b926
2 changed files with 3 additions and 0 deletions
|
@ -960,6 +960,7 @@ impl IntoInner<Buf> for OsString {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsInner<Slice> for OsStr {
|
impl AsInner<Slice> for OsStr {
|
||||||
|
#[inline]
|
||||||
fn as_inner(&self) -> &Slice {
|
fn as_inner(&self) -> &Slice {
|
||||||
&self.inner
|
&self.inner
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,9 +236,11 @@ pub trait OsStrExt {
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl OsStrExt for OsStr {
|
impl OsStrExt for OsStr {
|
||||||
|
#[inline]
|
||||||
fn from_bytes(slice: &[u8]) -> &OsStr {
|
fn from_bytes(slice: &[u8]) -> &OsStr {
|
||||||
unsafe { mem::transmute(slice) }
|
unsafe { mem::transmute(slice) }
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
fn as_bytes(&self) -> &[u8] {
|
fn as_bytes(&self) -> &[u8] {
|
||||||
&self.as_inner().inner
|
&self.as_inner().inner
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue