@@ -3604,24 +3604,20 @@ impl str {
3604
3604
/// Basic usage:
3605
3605
///
3606
3606
/// ```
3607
- /// #![feature(trim_direction)]
3608
- ///
3609
3607
/// let s = " Hello\tworld\t";
3610
3608
/// assert_eq!("Hello\tworld\t", s.trim_start());
3611
3609
/// ```
3612
3610
///
3613
3611
/// Directionality:
3614
3612
///
3615
3613
/// ```
3616
- /// #![feature(trim_direction)]
3617
- ///
3618
- /// let s = " English";
3614
+ /// let s = " English ";
3619
3615
/// assert!(Some('E') == s.trim_start().chars().next());
3620
3616
///
3621
- /// let s = " עברית";
3617
+ /// let s = " עברית ";
3622
3618
/// assert!(Some('ע') == s.trim_start().chars().next());
3623
3619
/// ```
3624
- #[ unstable ( feature = "trim_direction" , issue = "30459 " ) ]
3620
+ #[ stable ( feature = "trim_direction" , since = "1.30.0 " ) ]
3625
3621
pub fn trim_start ( & self ) -> & str {
3626
3622
self . trim_start_matches ( |c : char | c. is_whitespace ( ) )
3627
3623
}
@@ -3643,24 +3639,20 @@ impl str {
3643
3639
/// Basic usage:
3644
3640
///
3645
3641
/// ```
3646
- /// #![feature(trim_direction)]
3647
- ///
3648
3642
/// let s = " Hello\tworld\t";
3649
3643
/// assert_eq!(" Hello\tworld", s.trim_end());
3650
3644
/// ```
3651
3645
///
3652
3646
/// Directionality:
3653
3647
///
3654
3648
/// ```
3655
- /// #![feature(trim_direction)]
3656
- ///
3657
- /// let s = "English ";
3649
+ /// let s = " English ";
3658
3650
/// assert!(Some('h') == s.trim_end().chars().rev().next());
3659
3651
///
3660
- /// let s = "עברית ";
3652
+ /// let s = " עברית ";
3661
3653
/// assert!(Some('ת') == s.trim_end().chars().rev().next());
3662
3654
/// ```
3663
- #[ unstable ( feature = "trim_direction" , issue = "30459 " ) ]
3655
+ #[ stable ( feature = "trim_direction" , since = "1.30.0 " ) ]
3664
3656
pub fn trim_end ( & self ) -> & str {
3665
3657
self . trim_end_matches ( |c : char | c. is_whitespace ( ) )
3666
3658
}
@@ -3805,15 +3797,13 @@ impl str {
3805
3797
/// Basic usage:
3806
3798
///
3807
3799
/// ```
3808
- /// #![feature(trim_direction)]
3809
- ///
3810
3800
/// assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
3811
3801
/// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
3812
3802
///
3813
3803
/// let x: &[_] = &['1', '2'];
3814
3804
/// assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
3815
3805
/// ```
3816
- #[ unstable ( feature = "trim_direction" , issue = "30459 " ) ]
3806
+ #[ stable ( feature = "trim_direction" , since = "1.30.0 " ) ]
3817
3807
pub fn trim_start_matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> & ' a str {
3818
3808
let mut i = self . len ( ) ;
3819
3809
let mut matcher = pat. into_searcher ( self ) ;
@@ -3846,8 +3836,6 @@ impl str {
3846
3836
/// Simple patterns:
3847
3837
///
3848
3838
/// ```
3849
- /// #![feature(trim_direction)]
3850
- ///
3851
3839
/// assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
3852
3840
/// assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
3853
3841
///
@@ -3858,11 +3846,9 @@ impl str {
3858
3846
/// A more complex pattern, using a closure:
3859
3847
///
3860
3848
/// ```
3861
- /// #![feature(trim_direction)]
3862
- ///
3863
3849
/// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
3864
3850
/// ```
3865
- #[ unstable ( feature = "trim_direction" , issue = "30459 " ) ]
3851
+ #[ stable ( feature = "trim_direction" , since = "1.30.0 " ) ]
3866
3852
pub fn trim_end_matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> & ' a str
3867
3853
where P :: Searcher : ReverseSearcher < ' a >
3868
3854
{
0 commit comments