@@ -3604,14 +3604,17 @@ impl str {
36043604 /// Basic usage:
36053605 ///
36063606 /// ```
3607- /// let s = " Hello\tworld\t";
3607+ /// #![feature(trim_direction)]
36083608 ///
3609+ /// let s = " Hello\tworld\t";
36093610 /// assert_eq!("Hello\tworld\t", s.trim_start());
36103611 /// ```
36113612 ///
36123613 /// Directionality:
36133614 ///
36143615 /// ```
3616+ /// #![feature(trim_direction)]
3617+ ///
36153618 /// let s = " English";
36163619 /// assert!(Some('E') == s.trim_start().chars().next());
36173620 ///
@@ -3640,14 +3643,17 @@ impl str {
36403643 /// Basic usage:
36413644 ///
36423645 /// ```
3643- /// let s = " Hello\tworld\t";
3646+ /// #![feature(trim_direction)]
36443647 ///
3648+ /// let s = " Hello\tworld\t";
36453649 /// assert_eq!(" Hello\tworld", s.trim_end());
36463650 /// ```
36473651 ///
36483652 /// Directionality:
36493653 ///
36503654 /// ```
3655+ /// #![feature(trim_direction)]
3656+ ///
36513657 /// let s = "English ";
36523658 /// assert!(Some('h') == s.trim_end().chars().rev().next());
36533659 ///
@@ -3799,6 +3805,8 @@ impl str {
37993805 /// Basic usage:
38003806 ///
38013807 /// ```
3808+ /// #![feature(trim_direction)]
3809+ ///
38023810 /// assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
38033811 /// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
38043812 ///
@@ -3838,6 +3846,8 @@ impl str {
38383846 /// Simple patterns:
38393847 ///
38403848 /// ```
3849+ /// #![feature(trim_direction)]
3850+ ///
38413851 /// assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
38423852 /// assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
38433853 ///
@@ -3848,6 +3858,8 @@ impl str {
38483858 /// A more complex pattern, using a closure:
38493859 ///
38503860 /// ```
3861+ /// #![feature(trim_direction)]
3862+ ///
38513863 /// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
38523864 /// ```
38533865 #[ unstable( feature = "trim_direction" , issue = "30459" ) ]
0 commit comments