about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-04-05 12:46:51 +0200
committerGitHub <noreply@github.com>2019-04-05 12:46:51 +0200
commitc392832195ec9e900fe38cb76de7bf1e8e98df46 (patch)
tree568b5431b5c595b2dc0220fbe88b7fe9c65c8086 /src/libstd/sys_common
parent2e7be1ed6c1e3fec7b4aac6550f94694f5c43ae9 (diff)
parenta37c33b9261f534b56434c83258ff24d24bf9351 (diff)
downloadrust-c392832195ec9e900fe38cb76de7bf1e8e98df46.tar.gz
rust-c392832195ec9e900fe38cb76de7bf1e8e98df46.zip
Rollup merge of #59690 - xfix:patch-17, r=cramertj
Mark unix::ffi::OsStrExt methods as inline

This is a small change, but I found it surprising it's not inlined looking at the assembly.
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/os_str_bytes.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys_common/os_str_bytes.rs b/src/libstd/sys_common/os_str_bytes.rs
index 7cc93477a73..a4961974d89 100644
--- a/src/libstd/sys_common/os_str_bytes.rs
+++ b/src/libstd/sys_common/os_str_bytes.rs
@@ -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
     }