@@ -495,11 +495,13 @@ impl OsStr {
495495 ///
496496 /// let os_str = OsStr::new("foo");
497497 /// ```
498+ #[ inline]
498499 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
499500 pub fn new < S : AsRef < OsStr > + ?Sized > ( s : & S ) -> & OsStr {
500501 s. as_ref ( )
501502 }
502503
504+ #[ inline]
503505 fn from_inner ( inner : & Slice ) -> & OsStr {
504506 unsafe { & * ( inner as * const Slice as * const OsStr ) }
505507 }
@@ -658,6 +660,7 @@ impl OsStr {
658660 ///
659661 /// Note: it is *crucial* that this API is private, to avoid
660662 /// revealing the internal, platform-specific encodings.
663+ #[ inline]
661664 fn bytes ( & self ) -> & [ u8 ] {
662665 unsafe { & * ( & self . inner as * const _ as * const [ u8 ] ) }
663666 }
@@ -797,20 +800,23 @@ impl Default for &OsStr {
797800
798801#[ stable( feature = "rust1" , since = "1.0.0" ) ]
799802impl PartialEq for OsStr {
803+ #[ inline]
800804 fn eq ( & self , other : & OsStr ) -> bool {
801805 self . bytes ( ) . eq ( other. bytes ( ) )
802806 }
803807}
804808
805809#[ stable( feature = "rust1" , since = "1.0.0" ) ]
806810impl PartialEq < str > for OsStr {
811+ #[ inline]
807812 fn eq ( & self , other : & str ) -> bool {
808813 * self == * OsStr :: new ( other)
809814 }
810815}
811816
812817#[ stable( feature = "rust1" , since = "1.0.0" ) ]
813818impl PartialEq < OsStr > for str {
819+ #[ inline]
814820 fn eq ( & self , other : & OsStr ) -> bool {
815821 * other == * OsStr :: new ( self )
816822 }
@@ -944,13 +950,15 @@ impl AsRef<OsStr> for OsString {
944950
945951#[ stable( feature = "rust1" , since = "1.0.0" ) ]
946952impl AsRef < OsStr > for str {
953+ #[ inline]
947954 fn as_ref ( & self ) -> & OsStr {
948955 OsStr :: from_inner ( Slice :: from_str ( self ) )
949956 }
950957}
951958
952959#[ stable( feature = "rust1" , since = "1.0.0" ) ]
953960impl AsRef < OsStr > for String {
961+ #[ inline]
954962 fn as_ref ( & self ) -> & OsStr {
955963 ( & * * self ) . as_ref ( )
956964 }
0 commit comments