Skip to content

Commit 74e9057

Browse files
committed
modify remaining #[must_use[ messages
1 parent e7ce868 commit 74e9057

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libcore/str/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3581,7 +3581,7 @@ impl str {
35813581
/// let s = " עברית ";
35823582
/// assert!(Some('ע') == s.trim_start().chars().next());
35833583
/// ```
3584-
#[must_use = "this returns the trimmed string as a new allocation, \
3584+
#[must_use = "this returns the trimmed string as a new slice, \
35853585
without modifying the original"]
35863586
#[stable(feature = "trim_direction", since = "1.30.0")]
35873587
pub fn trim_start(&self) -> &str {
@@ -3618,7 +3618,7 @@ impl str {
36183618
/// let s = " עברית ";
36193619
/// assert!(Some('ת') == s.trim_end().chars().rev().next());
36203620
/// ```
3621-
#[must_use = "this returns the trimmed string as a new allocation, \
3621+
#[must_use = "this returns the trimmed string as a new slice, \
36223622
without modifying the original"]
36233623
#[stable(feature = "trim_direction", since = "1.30.0")]
36243624
pub fn trim_end(&self) -> &str {
@@ -3722,7 +3722,7 @@ impl str {
37223722
/// ```
37233723
/// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar");
37243724
/// ```
3725-
#[must_use = "this returns the trimmed string as a new allocation, \
3725+
#[must_use = "this returns the trimmed string as a new slice, \
37263726
without modifying the original"]
37273727
#[stable(feature = "rust1", since = "1.0.0")]
37283728
pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
@@ -3769,7 +3769,7 @@ impl str {
37693769
/// let x: &[_] = &['1', '2'];
37703770
/// assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12");
37713771
/// ```
3772-
#[must_use = "this returns the trimmed string as a new allocation, \
3772+
#[must_use = "this returns the trimmed string as a new slice, \
37733773
without modifying the original"]
37743774
#[stable(feature = "trim_direction", since = "1.30.0")]
37753775
pub fn trim_start_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str {
@@ -3814,7 +3814,7 @@ impl str {
38143814
/// ```
38153815
/// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
38163816
/// ```
3817-
#[must_use = "this returns the trimmed string as a new allocation, \
3817+
#[must_use = "this returns the trimmed string as a new slice, \
38183818
without modifying the original"]
38193819
#[stable(feature = "trim_direction", since = "1.30.0")]
38203820
pub fn trim_end_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str

0 commit comments

Comments
 (0)