@@ -425,6 +425,7 @@ impl str {
425
425
since = "1.0.0" ) ]
426
426
#[ unstable( feature = "unicode" ,
427
427
reason = "this functionality may only be provided by libunicode" ) ]
428
+ #[ inline]
428
429
pub fn width ( & self , is_cjk : bool ) -> usize {
429
430
UnicodeStr :: width ( self , is_cjk)
430
431
}
@@ -460,6 +461,7 @@ impl str {
460
461
with the existence of the char_indices iterator or \
461
462
this method may want to be replaced with checked \
462
463
slicing") ]
464
+ #[ inline]
463
465
pub fn is_char_boundary ( & self , index : usize ) -> bool {
464
466
core_str:: StrExt :: is_char_boundary ( self , index)
465
467
}
@@ -515,6 +517,7 @@ impl str {
515
517
/// }
516
518
/// ```
517
519
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
520
+ #[ inline]
518
521
pub unsafe fn slice_unchecked ( & self , begin : usize , end : usize ) -> & str {
519
522
core_str:: StrExt :: slice_unchecked ( self , begin, end)
520
523
}
@@ -523,6 +526,7 @@ impl str {
523
526
///
524
527
/// Same as `slice_unchecked`, but works with `&mut str` instead of `&str`.
525
528
#[ unstable( feature = "str_slice_mut" , reason = "recently added" ) ]
529
+ #[ inline]
526
530
pub unsafe fn slice_mut_unchecked ( & mut self , begin : usize , end : usize ) -> & mut str {
527
531
core_str:: StrExt :: slice_mut_unchecked ( self , begin, end)
528
532
}
@@ -558,6 +562,7 @@ impl str {
558
562
#[ deprecated( since = "1.3.0" ,
559
563
reason = "can be implemented with char_indices and \
560
564
hasn't seen enough use to justify inclusion") ]
565
+ #[ inline]
561
566
pub fn slice_chars ( & self , begin : usize , end : usize ) -> & str {
562
567
core_str:: StrExt :: slice_chars ( self , begin, end)
563
568
}
@@ -611,6 +616,7 @@ impl str {
611
616
reason = "often replaced by char_indices, this method may \
612
617
be removed in favor of just char_at() or eventually \
613
618
removed altogether") ]
619
+ #[ inline]
614
620
pub fn char_range_at ( & self , start : usize ) -> CharRange {
615
621
core_str:: StrExt :: char_range_at ( self , start)
616
622
}
@@ -669,6 +675,7 @@ impl str {
669
675
reason = "often replaced by char_indices, this method may \
670
676
be removed in favor of just char_at_reverse() or \
671
677
eventually removed altogether") ]
678
+ #[ inline]
672
679
pub fn char_range_at_reverse ( & self , start : usize ) -> CharRange {
673
680
core_str:: StrExt :: char_range_at_reverse ( self , start)
674
681
}
@@ -696,6 +703,7 @@ impl str {
696
703
future; it is normally replaced by chars/char_indices \
697
704
iterators or by getting the first char from a \
698
705
subslice") ]
706
+ #[ inline]
699
707
pub fn char_at ( & self , i : usize ) -> char {
700
708
core_str:: StrExt :: char_at ( self , i)
701
709
}
@@ -722,6 +730,7 @@ impl str {
722
730
reason = "see char_at for more details, but reverse semantics \
723
731
are also somewhat unclear, especially with which \
724
732
cases generate panics") ]
733
+ #[ inline]
725
734
pub fn char_at_reverse ( & self , i : usize ) -> char {
726
735
core_str:: StrExt :: char_at_reverse ( self , i)
727
736
}
@@ -756,6 +765,7 @@ impl str {
756
765
reason = "awaiting conventions about shifting and slices and \
757
766
may not be warranted with the existence of the chars \
758
767
and/or char_indices iterators") ]
768
+ #[ inline]
759
769
pub fn slice_shift_char ( & self ) -> Option < ( char , & str ) > {
760
770
core_str:: StrExt :: slice_shift_char ( self )
761
771
}
@@ -818,6 +828,7 @@ impl str {
818
828
/// '\u{1f1e8}', '\u{1f1ed}', ' ', '한']);
819
829
/// ```
820
830
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
831
+ #[ inline]
821
832
pub fn chars ( & self ) -> Chars {
822
833
core_str:: StrExt :: chars ( self )
823
834
}
@@ -833,6 +844,7 @@ impl str {
833
844
/// assert_eq!(v, b);
834
845
/// ```
835
846
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
847
+ #[ inline]
836
848
pub fn char_indices ( & self ) -> CharIndices {
837
849
core_str:: StrExt :: char_indices ( self )
838
850
}
@@ -847,6 +859,7 @@ impl str {
847
859
/// assert_eq!(v, b"bors".to_vec());
848
860
/// ```
849
861
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
862
+ #[ inline]
850
863
pub fn bytes ( & self ) -> Bytes {
851
864
core_str:: StrExt :: bytes ( self )
852
865
}
@@ -863,6 +876,7 @@ impl str {
863
876
/// assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
864
877
/// ```
865
878
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
879
+ #[ inline]
866
880
pub fn split_whitespace ( & self ) -> SplitWhitespace {
867
881
UnicodeStr :: split_whitespace ( self )
868
882
}
@@ -886,6 +900,7 @@ impl str {
886
900
#[ unstable( feature = "str_words" ,
887
901
reason = "the precise algorithm to use is unclear" ) ]
888
902
#[ allow( deprecated) ]
903
+ #[ inline]
889
904
pub fn words ( & self ) -> Words {
890
905
UnicodeStr :: words ( self )
891
906
}
@@ -912,6 +927,7 @@ impl str {
912
927
/// assert_eq!(v, ["foo", "bar", "", "baz"]);
913
928
/// ```
914
929
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
930
+ #[ inline]
915
931
pub fn lines ( & self ) -> Lines {
916
932
core_str:: StrExt :: lines ( self )
917
933
}
@@ -939,6 +955,7 @@ impl str {
939
955
/// assert_eq!(v, ["foo", "bar", "", "baz"]);
940
956
/// ```
941
957
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
958
+ #[ inline]
942
959
pub fn lines_any ( & self ) -> LinesAny {
943
960
core_str:: StrExt :: lines_any ( self )
944
961
}
0 commit comments