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

Better docs for the str primitive #30057

Merged
merged 1 commit into from
Dec 1, 2015
Merged

Conversation

steveklabnik
Copy link
Member

Part of #29338

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

/// Returns the length of `self` in bytes.
/// Returns the length of `self`.
///
/// This length is in bytes, not [`char`]s, or graphemes. In other words,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the comma after chars is potentially confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

///
/// # Safety
///
/// Caller must check both UTF-8 sequence boundaries and the boundaries
/// of the entire slice as well.
/// Callers of this function are responsible that three sets of bounds are
Copy link
Member

Choose a reason for hiding this comment

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

I usually call these things “preconditions”. Is there any pretext to use “sets of bounds” instead of “preconditions” or “requirements” or another familiar synonym?

Copy link
Member Author

Choose a reason for hiding this comment

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

There isn't, actually. It would be good to check what we use elsewhere, hmmm

@steveklabnik steveklabnik mentioned this pull request Nov 30, 2015
11 tasks
@steveklabnik
Copy link
Member Author

Okay, I think I've gotten all of the review questions except what to do about pointing to the unicode crate out of the way.

@alexcrichton
Copy link
Member

@bors: r+ 7b30f5c

@bors
Copy link
Contributor

bors commented Dec 1, 2015

⌛ Testing commit 7b30f5c with merge baf0208...

bors added a commit that referenced this pull request Dec 1, 2015
@bors bors merged commit 7b30f5c into rust-lang:master Dec 1, 2015
///
/// The pattern can be a simple `char`, or a closure that determines
/// The pattern can be a `&str`, [`char`], or a closure that determines
Copy link

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@CamJN in the future, can you file a new issue rather than making a comment on an old PR? This comment will get lost in the sands of time. Thanks!

(Also, I think you're right here)

@steveklabnik steveklabnik deleted the doc_str branch June 19, 2016 20:31
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.

7 participants