about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-15 11:28:23 +0100
committerGitHub <noreply@github.com>2022-01-15 11:28:23 +0100
commit1b241bb70365b06ccb6e0bc98fceb5cf76761d7b (patch)
tree97915b323c6e25593e52a98f422616513e3e4dbe
parentff1db43b5041c91cdb781f4e93c64c46c9d46451 (diff)
parent7e6d97bc39b1a4169db9f139c24abaac8f94048e (diff)
downloadrust-1b241bb70365b06ccb6e0bc98fceb5cf76761d7b.tar.gz
rust-1b241bb70365b06ccb6e0bc98fceb5cf76761d7b.zip
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.
-rw-r--r--library/std/src/os/unix/ffi/os_str.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/os/unix/ffi/os_str.rs b/library/std/src/os/unix/ffi/os_str.rs
index 54c9a9382f2..650f712bc6e 100644
--- a/library/std/src/os/unix/ffi/os_str.rs
+++ b/library/std/src/os/unix/ffi/os_str.rs
@@ -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
     }