Skip to content

Commit

Permalink
Update src/libcore/str/mod.rs, tweak must_use message
Browse files Browse the repository at this point in the history
trimmed string is returned as a slice instead of a new allocation

Co-Authored-By: matthiaskrgr <matthias.krueger@famsik.de>
  • Loading branch information
zackmdavis and matthiaskrgr committed Dec 26, 2018
1 parent 809a1a8 commit e7ce868
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ impl str {
///
/// assert_eq!("Hello\tworld", s.trim());
/// ```
#[must_use = "this returns the trimmed string as a new allocation, \
#[must_use = "this returns the trimmed string as a slice, \
without modifying the original"]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn trim(&self) -> &str {
Expand Down

0 comments on commit e7ce868

Please sign in to comment.