@@ -3581,7 +3581,7 @@ impl str {
3581
3581
/// let s = " עברית ";
3582
3582
/// assert!(Some('ע') == s.trim_start().chars().next());
3583
3583
/// ```
3584
- #[ must_use = "this returns the trimmed string as a new allocation , \
3584
+ #[ must_use = "this returns the trimmed string as a new slice , \
3585
3585
without modifying the original"]
3586
3586
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
3587
3587
pub fn trim_start ( & self ) -> & str {
@@ -3618,7 +3618,7 @@ impl str {
3618
3618
/// let s = " עברית ";
3619
3619
/// assert!(Some('ת') == s.trim_end().chars().rev().next());
3620
3620
/// ```
3621
- #[ must_use = "this returns the trimmed string as a new allocation , \
3621
+ #[ must_use = "this returns the trimmed string as a new slice , \
3622
3622
without modifying the original"]
3623
3623
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
3624
3624
pub fn trim_end ( & self ) -> & str {
@@ -3722,7 +3722,7 @@ impl str {
3722
3722
/// ```
3723
3723
/// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
3724
3724
/// ```
3725
- #[ must_use = "this returns the trimmed string as a new allocation , \
3725
+ #[ must_use = "this returns the trimmed string as a new slice , \
3726
3726
without modifying the original"]
3727
3727
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3728
3728
pub fn trim_matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> & ' a str
@@ -3769,7 +3769,7 @@ impl str {
3769
3769
/// let x: &[_] = &['1', '2'];
3770
3770
/// assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
3771
3771
/// ```
3772
- #[ must_use = "this returns the trimmed string as a new allocation , \
3772
+ #[ must_use = "this returns the trimmed string as a new slice , \
3773
3773
without modifying the original"]
3774
3774
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
3775
3775
pub fn trim_start_matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> & ' a str {
@@ -3814,7 +3814,7 @@ impl str {
3814
3814
/// ```
3815
3815
/// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
3816
3816
/// ```
3817
- #[ must_use = "this returns the trimmed string as a new allocation , \
3817
+ #[ must_use = "this returns the trimmed string as a new slice , \
3818
3818
without modifying the original"]
3819
3819
#[ stable( feature = "trim_direction" , since = "1.30.0" ) ]
3820
3820
pub fn trim_end_matches < ' a , P : Pattern < ' a > > ( & ' a self , pat : P ) -> & ' a str
0 commit comments