Rollup merge of #92775 - xfix:osstringext-inline, r=m-ou-se
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.
This commit is contained in:
commit
1b241bb703
1 changed files with 2 additions and 0 deletions
|
@ -28,9 +28,11 @@ pub trait OsStringExt: Sealed {
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl OsStringExt for OsString {
|
impl OsStringExt for OsString {
|
||||||
|
#[inline]
|
||||||
fn from_vec(vec: Vec<u8>) -> OsString {
|
fn from_vec(vec: Vec<u8>) -> OsString {
|
||||||
FromInner::from_inner(Buf { inner: vec })
|
FromInner::from_inner(Buf { inner: vec })
|
||||||
}
|
}
|
||||||
|
#[inline]
|
||||||
fn into_vec(self) -> Vec<u8> {
|
fn into_vec(self) -> Vec<u8> {
|
||||||
self.into_inner().inner
|
self.into_inner().inner
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue