Skip to content

Commit

Permalink
Rollup merge of #92775 - xfix:osstringext-inline, r=m-ou-se
Browse files Browse the repository at this point in the history
Inline std::os::unix::ffi::OsStringExt methods

Those methods essentially do nothing at assembly level. On Unix systems, `OsString` is represented as a `Vec` without performing any transformations.
  • Loading branch information
matthiaskrgr committed Jan 15, 2022
2 parents ff1db43 + 7e6d97b commit 1b241bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/std/src/os/unix/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ pub trait OsStringExt: Sealed {

#[stable(feature = "rust1", since = "1.0.0")]
impl OsStringExt for OsString {
#[inline]
fn from_vec(vec: Vec<u8>) -> OsString {
FromInner::from_inner(Buf { inner: vec })
}
#[inline]
fn into_vec(self) -> Vec<u8> {
self.into_inner().inner
}
Expand Down

0 comments on commit 1b241bb

Please sign in to comment.