@@ -3010,6 +3010,12 @@ impl str {
3010
3010
///
3011
3011
/// Returns `false` if it does not.
3012
3012
///
3013
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3014
+ /// function or closure that determines if a character matches.
3015
+ ///
3016
+ /// [`char`]: primitive.char.html
3017
+ /// [pattern]: str/pattern/index.html
3018
+ ///
3013
3019
/// # Examples
3014
3020
///
3015
3021
/// Basic usage:
@@ -3031,6 +3037,12 @@ impl str {
3031
3037
///
3032
3038
/// Returns `false` if it does not.
3033
3039
///
3040
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3041
+ /// function or closure that determines if a character matches.
3042
+ ///
3043
+ /// [`char`]: primitive.char.html
3044
+ /// [pattern]: str/pattern/index.html
3045
+ ///
3034
3046
/// # Examples
3035
3047
///
3036
3048
/// Basic usage:
@@ -3051,6 +3063,12 @@ impl str {
3051
3063
///
3052
3064
/// Returns `false` if it does not.
3053
3065
///
3066
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3067
+ /// function or closure that determines if a character matches.
3068
+ ///
3069
+ /// [`char`]: primitive.char.html
3070
+ /// [pattern]: str/pattern/index.html
3071
+ ///
3054
3072
/// # Examples
3055
3073
///
3056
3074
/// Basic usage:
@@ -3074,10 +3092,12 @@ impl str {
3074
3092
///
3075
3093
/// Returns [`None`] if the pattern doesn't match.
3076
3094
///
3077
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
3078
- /// a character matches.
3095
+ /// The [ pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3096
+ /// function or closure that determines if a character matches.
3079
3097
///
3080
3098
/// [`None`]: option/enum.Option.html#variant.None
3099
+ /// [`char`]: primitive.char.html
3100
+ /// [pattern]: str/pattern/index.html
3081
3101
///
3082
3102
/// # Examples
3083
3103
///
@@ -3121,10 +3141,12 @@ impl str {
3121
3141
///
3122
3142
/// Returns [`None`] if the pattern doesn't match.
3123
3143
///
3124
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
3125
- /// a character matches.
3144
+ /// The [ pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3145
+ /// function or closure that determines if a character matches.
3126
3146
///
3127
3147
/// [`None`]: option/enum.Option.html#variant.None
3148
+ /// [`char`]: primitive.char.html
3149
+ /// [pattern]: str/pattern/index.html
3128
3150
///
3129
3151
/// # Examples
3130
3152
///
@@ -3166,8 +3188,11 @@ impl str {
3166
3188
/// An iterator over substrings of this string slice, separated by
3167
3189
/// characters matched by a pattern.
3168
3190
///
3169
- /// The pattern can be any type that implements the Pattern trait. Notable
3170
- /// examples are `&str`, [`char`], and closures that determines the split.
3191
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3192
+ /// function or closure that determines if a character matches.
3193
+ ///
3194
+ /// [`char`]: primitive.char.html
3195
+ /// [pattern]: str/pattern/index.html
3171
3196
///
3172
3197
/// # Iterator behavior
3173
3198
///
@@ -3285,6 +3310,12 @@ impl str {
3285
3310
/// `split` in that `split_inclusive` leaves the matched part as the
3286
3311
/// terminator of the substring.
3287
3312
///
3313
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3314
+ /// function or closure that determines if a character matches.
3315
+ ///
3316
+ /// [`char`]: primitive.char.html
3317
+ /// [pattern]: str/pattern/index.html
3318
+ ///
3288
3319
/// # Examples
3289
3320
///
3290
3321
/// ```
@@ -3319,8 +3350,11 @@ impl str {
3319
3350
/// An iterator over substrings of the given string slice, separated by
3320
3351
/// characters matched by a pattern and yielded in reverse order.
3321
3352
///
3322
- /// The pattern can be any type that implements the Pattern trait. Notable
3323
- /// examples are `&str`, [`char`], and closures that determines the split.
3353
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3354
+ /// function or closure that determines if a character matches.
3355
+ ///
3356
+ /// [`char`]: primitive.char.html
3357
+ /// [pattern]: str/pattern/index.html
3324
3358
///
3325
3359
/// # Iterator behavior
3326
3360
///
@@ -3370,8 +3404,11 @@ impl str {
3370
3404
/// An iterator over substrings of the given string slice, separated by
3371
3405
/// characters matched by a pattern.
3372
3406
///
3373
- /// The pattern can be any type that implements the Pattern trait. Notable
3374
- /// examples are `&str`, [`char`], and closures that determines the split.
3407
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3408
+ /// function or closure that determines if a character matches.
3409
+ ///
3410
+ /// [`char`]: primitive.char.html
3411
+ /// [pattern]: str/pattern/index.html
3375
3412
///
3376
3413
/// Equivalent to [`split`], except that the trailing substring
3377
3414
/// is skipped if empty.
@@ -3414,10 +3451,11 @@ impl str {
3414
3451
/// An iterator over substrings of `self`, separated by characters
3415
3452
/// matched by a pattern and yielded in reverse order.
3416
3453
///
3417
- /// The pattern can be any type that implements the Pattern trait. Notable
3418
- /// examples are `&str`, [`char`], and closures that determines the split.
3419
- /// Additional libraries might provide more complex patterns like
3420
- /// regular expressions.
3454
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3455
+ /// function or closure that determines if a character matches.
3456
+ ///
3457
+ /// [`char`]: primitive.char.html
3458
+ /// [pattern]: str/pattern/index.html
3421
3459
///
3422
3460
/// Equivalent to [`split`], except that the trailing substring is
3423
3461
/// skipped if empty.
@@ -3462,8 +3500,11 @@ impl str {
3462
3500
/// If `n` substrings are returned, the last substring (the `n`th substring)
3463
3501
/// will contain the remainder of the string.
3464
3502
///
3465
- /// The pattern can be any type that implements the Pattern trait. Notable
3466
- /// examples are `&str`, [`char`], and closures that determines the split.
3503
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3504
+ /// function or closure that determines if a character matches.
3505
+ ///
3506
+ /// [`char`]: primitive.char.html
3507
+ /// [pattern]: str/pattern/index.html
3467
3508
///
3468
3509
/// # Iterator behavior
3469
3510
///
@@ -3512,8 +3553,11 @@ impl str {
3512
3553
/// If `n` substrings are returned, the last substring (the `n`th substring)
3513
3554
/// will contain the remainder of the string.
3514
3555
///
3515
- /// The pattern can be any type that implements the Pattern trait. Notable
3516
- /// examples are `&str`, [`char`], and closures that determines the split.
3556
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3557
+ /// function or closure that determines if a character matches.
3558
+ ///
3559
+ /// [`char`]: primitive.char.html
3560
+ /// [pattern]: str/pattern/index.html
3517
3561
///
3518
3562
/// # Iterator behavior
3519
3563
///
@@ -3557,8 +3601,11 @@ impl str {
3557
3601
/// An iterator over the disjoint matches of a pattern within the given string
3558
3602
/// slice.
3559
3603
///
3560
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
3561
- /// a character matches.
3604
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3605
+ /// function or closure that determines if a character matches.
3606
+ ///
3607
+ /// [`char`]: primitive.char.html
3608
+ /// [pattern]: str/pattern/index.html
3562
3609
///
3563
3610
/// # Iterator behavior
3564
3611
///
@@ -3593,8 +3640,11 @@ impl str {
3593
3640
/// An iterator over the disjoint matches of a pattern within this string slice,
3594
3641
/// yielded in reverse order.
3595
3642
///
3596
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
3597
- /// a character matches.
3643
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3644
+ /// function or closure that determines if a character matches.
3645
+ ///
3646
+ /// [`char`]: primitive.char.html
3647
+ /// [pattern]: str/pattern/index.html
3598
3648
///
3599
3649
/// # Iterator behavior
3600
3650
///
@@ -3634,8 +3684,11 @@ impl str {
3634
3684
/// For matches of `pat` within `self` that overlap, only the indices
3635
3685
/// corresponding to the first match are returned.
3636
3686
///
3637
- /// The pattern can be a `&str`, [`char`], or a closure that determines
3638
- /// if a character matches.
3687
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3688
+ /// function or closure that determines if a character matches.
3689
+ ///
3690
+ /// [`char`]: primitive.char.html
3691
+ /// [pattern]: str/pattern/index.html
3639
3692
///
3640
3693
/// # Iterator behavior
3641
3694
///
@@ -3676,8 +3729,11 @@ impl str {
3676
3729
/// For matches of `pat` within `self` that overlap, only the indices
3677
3730
/// corresponding to the last match are returned.
3678
3731
///
3679
- /// The pattern can be a `&str`, [`char`], or a closure that determines if a
3680
- /// character matches.
3732
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
3733
+ /// function or closure that determines if a character matches.
3734
+ ///
3735
+ /// [`char`]: primitive.char.html
3736
+ /// [pattern]: str/pattern/index.html
3681
3737
///
3682
3738
/// # Iterator behavior
3683
3739
///
@@ -3894,8 +3950,11 @@ impl str {
3894
3950
/// Returns a string slice with all prefixes and suffixes that match a
3895
3951
/// pattern repeatedly removed.
3896
3952
///
3897
- /// The pattern can be a [`char`] or a closure that determines if a
3898
- /// character matches.
3953
+ /// The [pattern] can be a [`char`], a slice of [`char`]s, or a function
3954
+ /// or closure that determines if a character matches.
3955
+ ///
3956
+ /// [`char`]: primitive.char.html
3957
+ /// [pattern]: str/pattern/index.html
3899
3958
///
3900
3959
/// # Examples
3901
3960
///
@@ -3939,8 +3998,11 @@ impl str {
3939
3998
/// Returns a string slice with all prefixes that match a pattern
3940
3999
/// repeatedly removed.
3941
4000
///
3942
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
3943
- /// a character matches.
4001
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4002
+ /// function or closure that determines if a character matches.
4003
+ ///
4004
+ /// [`char`]: primitive.char.html
4005
+ /// [pattern]: str/pattern/index.html
3944
4006
///
3945
4007
/// # Text directionality
3946
4008
///
@@ -3981,6 +4043,12 @@ impl str {
3981
4043
///
3982
4044
/// If the string does not start with `prefix`, `None` is returned.
3983
4045
///
4046
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4047
+ /// function or closure that determines if a character matches.
4048
+ ///
4049
+ /// [`char`]: primitive.char.html
4050
+ /// [pattern]: str/pattern/index.html
4051
+ ///
3984
4052
/// # Examples
3985
4053
///
3986
4054
/// ```
@@ -4005,6 +4073,12 @@ impl str {
4005
4073
///
4006
4074
/// If the string does not end with `suffix`, `None` is returned.
4007
4075
///
4076
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4077
+ /// function or closure that determines if a character matches.
4078
+ ///
4079
+ /// [`char`]: primitive.char.html
4080
+ /// [pattern]: str/pattern/index.html
4081
+ ///
4008
4082
/// # Examples
4009
4083
///
4010
4084
/// ```
@@ -4027,8 +4101,11 @@ impl str {
4027
4101
/// Returns a string slice with all suffixes that match a pattern
4028
4102
/// repeatedly removed.
4029
4103
///
4030
- /// The pattern can be a `&str`, [`char`], or a closure that
4031
- /// determines if a character matches.
4104
+ /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4105
+ /// function or closure that determines if a character matches.
4106
+ ///
4107
+ /// [`char`]: primitive.char.html
4108
+ /// [pattern]: str/pattern/index.html
4032
4109
///
4033
4110
/// # Text directionality
4034
4111
///
@@ -4073,10 +4150,11 @@ impl str {
4073
4150
/// Returns a string slice with all prefixes that match a pattern
4074
4151
/// repeatedly removed.
4075
4152
///
4076
- /// The pattern can be a `&str`, [`char`], or a closure that determines if
4077
- /// a character matches.
4153
+ /// The [ pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4154
+ /// function or closure that determines if a character matches.
4078
4155
///
4079
4156
/// [`char`]: primitive.char.html
4157
+ /// [pattern]: str/pattern/index.html
4080
4158
///
4081
4159
/// # Text directionality
4082
4160
///
@@ -4109,10 +4187,11 @@ impl str {
4109
4187
/// Returns a string slice with all suffixes that match a pattern
4110
4188
/// repeatedly removed.
4111
4189
///
4112
- /// The pattern can be a `&str`, [`char`], or a closure that
4113
- /// determines if a character matches.
4190
+ /// The [ pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
4191
+ /// function or closure that determines if a character matches.
4114
4192
///
4115
4193
/// [`char`]: primitive.char.html
4194
+ /// [pattern]: str/pattern/index.html
4116
4195
///
4117
4196
/// # Text directionality
4118
4197
///
0 commit comments