-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clarify documentation for string slicing (Index impls) #32099
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@bors: r+ 3b0bbbc99d81b34d72256b2fa7f3daa04584a4cd rollup Thanks! |
/// | ||
/// Equivalent to `self[begin .. self.len()]`. | ||
/// Returns a slice of the string from the beginning to byte offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be "from byte offset begin
to the end."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this!
- Mention the sugared syntax for the implementations, since it's not apparent from the docs that `Index<Range<usize>>` corresponds to `&self[a..b]`. - Be specific in that start <= end and end <= len
3b0bbbc
to
55671a0
Compare
@bors r=alexcrichton rollup I fixed the small mistakes. |
📌 Commit 55671a0 has been approved by |
…chton Clarify documentation for string slicing (Index impls) Clarify documentation for string slicing (Index impls) - Mention the sugared syntax for the implementations, since it's not apparent from the docs that `Index<Range<usize>>` corresponds to `&self[a..b]`. - Be specific in that start <= end and end <= len This is just one fix in response to rust-lang#32057
…chton Clarify documentation for string slicing (Index impls) Clarify documentation for string slicing (Index impls) - Mention the sugared syntax for the implementations, since it's not apparent from the docs that `Index<Range<usize>>` corresponds to `&self[a..b]`. - Be specific in that start <= end and end <= len This is just one fix in response to rust-lang#32057
This is a follow up for PR rust-lang#32099 and rust-lang#32057
Clarify doc for slice slicing (Index impls) Clarify doc for slice slicing (Index impls) This is a follow up for PR rust-lang#32099 and rust-lang#32057
Clarify doc for slice slicing (Index impls) Clarify doc for slice slicing (Index impls) This is a follow up for PR rust-lang#32099 and rust-lang#32057
Clarify documentation for string slicing (Index impls)
apparent from the docs that
Index<Range<usize>>
corresponds to&self[a..b]
.This is just one fix in response to #32057