@@ -172,6 +172,7 @@ impl fmt::Debug for CStr {
172172
173173#[ stable( feature = "cstr_default" , since = "1.10.0" ) ]
174174impl Default for & CStr {
175+ #[ inline]
175176 fn default ( ) -> Self {
176177 const SLICE : & [ c_char ] = & [ 0 ] ;
177178 // SAFETY: `SLICE` is indeed pointing to a valid nul-terminated string.
@@ -623,6 +624,7 @@ impl CStr {
623624
624625#[ stable( feature = "rust1" , since = "1.0.0" ) ]
625626impl PartialEq for CStr {
627+ #[ inline]
626628 fn eq ( & self , other : & CStr ) -> bool {
627629 self . to_bytes ( ) . eq ( other. to_bytes ( ) )
628630 }
@@ -631,12 +633,14 @@ impl PartialEq for CStr {
631633impl Eq for CStr { }
632634#[ stable( feature = "rust1" , since = "1.0.0" ) ]
633635impl PartialOrd for CStr {
636+ #[ inline]
634637 fn partial_cmp ( & self , other : & CStr ) -> Option < Ordering > {
635638 self . to_bytes ( ) . partial_cmp ( & other. to_bytes ( ) )
636639 }
637640}
638641#[ stable( feature = "rust1" , since = "1.0.0" ) ]
639642impl Ord for CStr {
643+ #[ inline]
640644 fn cmp ( & self , other : & CStr ) -> Ordering {
641645 self . to_bytes ( ) . cmp ( & other. to_bytes ( ) )
642646 }
@@ -646,6 +650,7 @@ impl Ord for CStr {
646650impl ops:: Index < ops:: RangeFrom < usize > > for CStr {
647651 type Output = CStr ;
648652
653+ #[ inline]
649654 fn index ( & self , index : ops:: RangeFrom < usize > ) -> & CStr {
650655 let bytes = self . to_bytes_with_nul ( ) ;
651656 // we need to manually check the starting index to account for the null
0 commit comments