@@ -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
}
@@ -459,6 +460,7 @@ impl str {
459
460
with the existence of the char_indices iterator or \
460
461
this method may want to be replaced with checked \
461
462
slicing") ]
463
+ #[ inline]
462
464
pub fn is_char_boundary ( & self , index : usize ) -> bool {
463
465
core_str:: StrExt :: is_char_boundary ( self , index)
464
466
}
@@ -514,6 +516,7 @@ impl str {
514
516
/// }
515
517
/// ```
516
518
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
519
+ #[ inline]
517
520
pub unsafe fn slice_unchecked ( & self , begin : usize , end : usize ) -> & str {
518
521
core_str:: StrExt :: slice_unchecked ( self , begin, end)
519
522
}
@@ -522,6 +525,7 @@ impl str {
522
525
///
523
526
/// Same as `slice_unchecked`, but works with `&mut str` instead of `&str`.
524
527
#[ unstable( feature = "str_slice_mut" , reason = "recently added" ) ]
528
+ #[ inline]
525
529
pub unsafe fn slice_mut_unchecked ( & mut self , begin : usize , end : usize ) -> & mut str {
526
530
core_str:: StrExt :: slice_mut_unchecked ( self , begin, end)
527
531
}
@@ -556,6 +560,7 @@ impl str {
556
560
#[ deprecated( since = "1.3.0" ,
557
561
reason = "can be implemented with char_indices and \
558
562
hasn't seen enough use to justify inclusion") ]
563
+ #[ inline]
559
564
pub fn slice_chars ( & self , begin : usize , end : usize ) -> & str {
560
565
core_str:: StrExt :: slice_chars ( self , begin, end)
561
566
}
@@ -608,6 +613,7 @@ impl str {
608
613
reason = "often replaced by char_indices, this method may \
609
614
be removed in favor of just char_at() or eventually \
610
615
removed altogether") ]
616
+ #[ inline]
611
617
pub fn char_range_at ( & self , start : usize ) -> CharRange {
612
618
core_str:: StrExt :: char_range_at ( self , start)
613
619
}
@@ -665,6 +671,7 @@ impl str {
665
671
reason = "often replaced by char_indices, this method may \
666
672
be removed in favor of just char_at_reverse() or \
667
673
eventually removed altogether") ]
674
+ #[ inline]
668
675
pub fn char_range_at_reverse ( & self , start : usize ) -> CharRange {
669
676
core_str:: StrExt :: char_range_at_reverse ( self , start)
670
677
}
@@ -691,6 +698,7 @@ impl str {
691
698
future; it is normally replaced by chars/char_indices \
692
699
iterators or by getting the first char from a \
693
700
subslice") ]
701
+ #[ inline]
694
702
pub fn char_at ( & self , i : usize ) -> char {
695
703
core_str:: StrExt :: char_at ( self , i)
696
704
}
@@ -716,6 +724,7 @@ impl str {
716
724
reason = "see char_at for more details, but reverse semantics \
717
725
are also somewhat unclear, especially with which \
718
726
cases generate panics") ]
727
+ #[ inline]
719
728
pub fn char_at_reverse ( & self , i : usize ) -> char {
720
729
core_str:: StrExt :: char_at_reverse ( self , i)
721
730
}
@@ -749,6 +758,7 @@ impl str {
749
758
reason = "awaiting conventions about shifting and slices and \
750
759
may not be warranted with the existence of the chars \
751
760
and/or char_indices iterators") ]
761
+ #[ inline]
752
762
pub fn slice_shift_char ( & self ) -> Option < ( char , & str ) > {
753
763
core_str:: StrExt :: slice_shift_char ( self )
754
764
}
@@ -810,6 +820,7 @@ impl str {
810
820
/// '\u{1f1e8}', '\u{1f1ed}', ' ', '한']);
811
821
/// ```
812
822
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
823
+ #[ inline]
813
824
pub fn chars ( & self ) -> Chars {
814
825
core_str:: StrExt :: chars ( self )
815
826
}
@@ -825,6 +836,7 @@ impl str {
825
836
/// assert_eq!(v, b);
826
837
/// ```
827
838
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
839
+ #[ inline]
828
840
pub fn char_indices ( & self ) -> CharIndices {
829
841
core_str:: StrExt :: char_indices ( self )
830
842
}
@@ -839,6 +851,7 @@ impl str {
839
851
/// assert_eq!(v, b"bors".to_vec());
840
852
/// ```
841
853
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
854
+ #[ inline]
842
855
pub fn bytes ( & self ) -> Bytes {
843
856
core_str:: StrExt :: bytes ( self )
844
857
}
@@ -855,6 +868,7 @@ impl str {
855
868
/// assert_eq!(v, ["Mary", "had", "a", "little", "lamb"]);
856
869
/// ```
857
870
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
871
+ #[ inline]
858
872
pub fn split_whitespace ( & self ) -> SplitWhitespace {
859
873
UnicodeStr :: split_whitespace ( self )
860
874
}
@@ -877,6 +891,7 @@ impl str {
877
891
#[ unstable( feature = "str_words" ,
878
892
reason = "the precise algorithm to use is unclear" ) ]
879
893
#[ allow( deprecated) ]
894
+ #[ inline]
880
895
pub fn words ( & self ) -> Words {
881
896
UnicodeStr :: words ( self )
882
897
}
@@ -903,6 +918,7 @@ impl str {
903
918
/// assert_eq!(v, ["foo", "bar", "", "baz"]);
904
919
/// ```
905
920
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
921
+ #[ inline]
906
922
pub fn lines ( & self ) -> Lines {
907
923
core_str:: StrExt :: lines ( self )
908
924
}
@@ -930,6 +946,7 @@ impl str {
930
946
/// assert_eq!(v, ["foo", "bar", "", "baz"]);
931
947
/// ```
932
948
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
949
+ #[ inline]
933
950
pub fn lines_any ( & self ) -> LinesAny {
934
951
core_str:: StrExt :: lines_any ( self )
935
952
}
0 commit comments