Skip to content

Commit

Permalink
Mark unix::ffi::OsStrExt methods as inline
Browse files Browse the repository at this point in the history
  • Loading branch information
KamilaBorowska committed Apr 4, 2019
1 parent f717b58 commit a37c33b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ impl IntoInner<Buf> for OsString {
}

impl AsInner<Slice> for OsStr {
#[inline]
fn as_inner(&self) -> &Slice {
&self.inner
}
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys_common/os_str_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ pub trait OsStrExt {

#[stable(feature = "rust1", since = "1.0.0")]
impl OsStrExt for OsStr {
#[inline]
fn from_bytes(slice: &[u8]) -> &OsStr {
unsafe { mem::transmute(slice) }
}
#[inline]
fn as_bytes(&self) -> &[u8] {
&self.as_inner().inner
}
Expand Down

0 comments on commit a37c33b

Please sign in to comment.