Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Clears up trim_char doc #18460

Merged
merged 1 commit into from
Nov 3, 2014
Merged

Doc: Clears up trim_char doc #18460

merged 1 commit into from
Nov 3, 2014

Conversation

gamazeps
Copy link
Contributor

Closes #18451

@@ -1535,7 +1535,7 @@ pub trait StrSlice<'a> {
/// ```
fn ends_with(&self, needle: &str) -> bool;

/// Returns a string with characters that match `to_trim` removed.
/// Returns a string with characters that match `to_trim` removed from the left and the right.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "beginning and the end" would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made the comment 2 lines long :p

I'll update it if it's unclear :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's the terminilogy used in the other trim methods, so it seems more consistent

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gamazeps OK, sounds good!

@steveklabnik
Copy link
Member

Historically, 'trim' implies the ends, but it's not bad to be more clear. Thank you!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 31, 2014
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 3, 2014
bors added a commit that referenced this pull request Nov 3, 2014
@bors bors closed this Nov 3, 2014
@bors bors merged commit bd9c181 into rust-lang:master Nov 3, 2014
@gamazeps gamazeps deleted the issue18451 branch May 7, 2017 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's not obvious that trim_char only operates on the ends
5 participants