@@ -813,6 +813,7 @@ impl str {
813
813
/// assert!(!bananas.contains("apples"));
814
814
/// ```
815
815
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
816
+ #[ inline]
816
817
pub fn contains < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> bool {
817
818
core_str:: StrExt :: contains ( self , pat)
818
819
}
@@ -900,6 +901,7 @@ impl str {
900
901
/// assert_eq!(s.find(x), None);
901
902
/// ```
902
903
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
904
+ #[ inline]
903
905
pub fn find < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Option < usize > {
904
906
core_str:: StrExt :: find ( self , pat)
905
907
}
@@ -944,6 +946,7 @@ impl str {
944
946
/// assert_eq!(s.rfind(x), None);
945
947
/// ```
946
948
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
949
+ #[ inline]
947
950
pub fn rfind < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Option < usize >
948
951
where P :: Searcher : ReverseSearcher < ' a >
949
952
{
@@ -1057,6 +1060,7 @@ impl str {
1057
1060
///
1058
1061
/// [`split_whitespace`]: #method.split_whitespace
1059
1062
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1063
+ #[ inline]
1060
1064
pub fn split < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Split < ' a , P > {
1061
1065
core_str:: StrExt :: split ( self , pat)
1062
1066
}
@@ -1106,6 +1110,7 @@ impl str {
1106
1110
/// assert_eq!(v, ["ghi", "def", "abc"]);
1107
1111
/// ```
1108
1112
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1113
+ #[ inline]
1109
1114
pub fn rsplit < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> RSplit < ' a , P >
1110
1115
where P :: Searcher : ReverseSearcher < ' a >
1111
1116
{
@@ -1152,6 +1157,7 @@ impl str {
1152
1157
/// assert_eq!(v, ["A", "", "B", ""]);
1153
1158
/// ```
1154
1159
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1160
+ #[ inline]
1155
1161
pub fn split_terminator < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> SplitTerminator < ' a , P > {
1156
1162
core_str:: StrExt :: split_terminator ( self , pat)
1157
1163
}
@@ -1195,6 +1201,7 @@ impl str {
1195
1201
/// assert_eq!(v, ["", "B", "", "A"]);
1196
1202
/// ```
1197
1203
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1204
+ #[ inline]
1198
1205
pub fn rsplit_terminator < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> RSplitTerminator < ' a , P >
1199
1206
where P :: Searcher : ReverseSearcher < ' a >
1200
1207
{
@@ -1247,6 +1254,7 @@ impl str {
1247
1254
/// assert_eq!(v, ["abc", "defXghi"]);
1248
1255
/// ```
1249
1256
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1257
+ #[ inline]
1250
1258
pub fn splitn < ' a , P : Pattern < ' a > > ( & ' a self , n : usize , pat : P ) -> SplitN < ' a , P > {
1251
1259
core_str:: StrExt :: splitn ( self , n, pat)
1252
1260
}
@@ -1294,6 +1302,7 @@ impl str {
1294
1302
/// assert_eq!(v, ["ghi", "abc1def"]);
1295
1303
/// ```
1296
1304
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1305
+ #[ inline]
1297
1306
pub fn rsplitn < ' a , P : Pattern < ' a > > ( & ' a self , n : usize , pat : P ) -> RSplitN < ' a , P >
1298
1307
where P :: Searcher : ReverseSearcher < ' a >
1299
1308
{
@@ -1334,6 +1343,7 @@ impl str {
1334
1343
/// assert_eq!(v, ["1", "2", "3"]);
1335
1344
/// ```
1336
1345
#[ stable( feature = "str_matches" , since = "1.2.0" ) ]
1346
+ #[ inline]
1337
1347
pub fn matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> Matches < ' a , P > {
1338
1348
core_str:: StrExt :: matches ( self , pat)
1339
1349
}
@@ -1370,6 +1380,7 @@ impl str {
1370
1380
/// assert_eq!(v, ["3", "2", "1"]);
1371
1381
/// ```
1372
1382
#[ stable( feature = "str_matches" , since = "1.2.0" ) ]
1383
+ #[ inline]
1373
1384
pub fn rmatches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> RMatches < ' a , P >
1374
1385
where P :: Searcher : ReverseSearcher < ' a >
1375
1386
{
@@ -1415,6 +1426,7 @@ impl str {
1415
1426
/// assert_eq!(v, [(0, "aba")]); // only the first `aba`
1416
1427
/// ```
1417
1428
#[ stable( feature = "str_match_indices" , since = "1.5.0" ) ]
1429
+ #[ inline]
1418
1430
pub fn match_indices < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> MatchIndices < ' a , P > {
1419
1431
core_str:: StrExt :: match_indices ( self , pat)
1420
1432
}
@@ -1457,6 +1469,7 @@ impl str {
1457
1469
/// assert_eq!(v, [(2, "aba")]); // only the last `aba`
1458
1470
/// ```
1459
1471
#[ stable( feature = "str_match_indices" , since = "1.5.0" ) ]
1472
+ #[ inline]
1460
1473
pub fn rmatch_indices < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> RMatchIndices < ' a , P >
1461
1474
where P :: Searcher : ReverseSearcher < ' a >
1462
1475
{
@@ -1737,6 +1750,7 @@ impl str {
1737
1750
/// assert_eq!(s, s.replace("cookie monster", "little lamb"));
1738
1751
/// ```
1739
1752
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1753
+ #[ inline]
1740
1754
pub fn replace < ' a , P : Pattern < ' a > > ( & ' a self , from : P , to : & str ) -> String {
1741
1755
let mut result = String :: new ( ) ;
1742
1756
let mut last_end = 0 ;
0 commit comments