@@ -172,6 +172,7 @@ impl fmt::Debug for CStr {
172
172
173
173
#[ stable( feature = "cstr_default" , since = "1.10.0" ) ]
174
174
impl Default for & CStr {
175
+ #[ inline]
175
176
fn default ( ) -> Self {
176
177
const SLICE : & [ c_char ] = & [ 0 ] ;
177
178
// SAFETY: `SLICE` is indeed pointing to a valid nul-terminated string.
@@ -623,6 +624,7 @@ impl CStr {
623
624
624
625
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
625
626
impl PartialEq for CStr {
627
+ #[ inline]
626
628
fn eq ( & self , other : & CStr ) -> bool {
627
629
self . to_bytes ( ) . eq ( other. to_bytes ( ) )
628
630
}
@@ -631,12 +633,14 @@ impl PartialEq for CStr {
631
633
impl Eq for CStr { }
632
634
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
633
635
impl PartialOrd for CStr {
636
+ #[ inline]
634
637
fn partial_cmp ( & self , other : & CStr ) -> Option < Ordering > {
635
638
self . to_bytes ( ) . partial_cmp ( & other. to_bytes ( ) )
636
639
}
637
640
}
638
641
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
639
642
impl Ord for CStr {
643
+ #[ inline]
640
644
fn cmp ( & self , other : & CStr ) -> Ordering {
641
645
self . to_bytes ( ) . cmp ( & other. to_bytes ( ) )
642
646
}
@@ -646,6 +650,7 @@ impl Ord for CStr {
646
650
impl ops:: Index < ops:: RangeFrom < usize > > for CStr {
647
651
type Output = CStr ;
648
652
653
+ #[ inline]
649
654
fn index ( & self , index : ops:: RangeFrom < usize > ) -> & CStr {
650
655
let bytes = self . to_bytes_with_nul ( ) ;
651
656
// we need to manually check the starting index to account for the null
0 commit comments