Skip to content

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

Merged
merged 1 commit into from
Mar 9, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Mar 7, 2016

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 #32057

@alexcrichton
Copy link
Member

@bors: r+ 3b0bbbc99d81b34d72256b2fa7f3daa04584a4cd rollup

Thanks!

///
/// Equivalent to `self[begin .. self.len()]`.
/// Returns a slice of the string from the beginning to byte offset
Copy link
Member

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."

Copy link
Member Author

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
@bluss bluss force-pushed the doc-string-slicing branch from 3b0bbbc to 55671a0 Compare March 7, 2016 20:05
@bluss
Copy link
Member Author

bluss commented Mar 7, 2016

@bors r=alexcrichton rollup

I fixed the small mistakes.

@bors
Copy link
Collaborator

bors commented Mar 7, 2016

📌 Commit 55671a0 has been approved by alexcrichton

@alexcrichton alexcrichton self-assigned this Mar 8, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Mar 8, 2016
…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
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Mar 8, 2016
…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
bors added a commit that referenced this pull request Mar 9, 2016
Rollup of 7 pull requests

- Successful merges: #31772, #32083, #32084, #32092, #32099, #32103, #32115
- Failed merges:
@bors bors merged commit 55671a0 into rust-lang:master Mar 9, 2016
bluss added a commit to bluss/rust that referenced this pull request Mar 10, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Mar 11, 2016
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
Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 12, 2016
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants