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

fix off-by-one error #47330

Merged
merged 1 commit into from
Jan 15, 2018
Merged

fix off-by-one error #47330

merged 1 commit into from
Jan 15, 2018

Conversation

bmusin
Copy link
Contributor

@bmusin bmusin commented Jan 10, 2018

Fixes #47325.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@kennytm kennytm added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jan 10, 2018
@steveklabnik
Copy link
Member

Nice catch, thank you!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 10, 2018

📌 Commit 0e9dde9 has been approved by steveklabnik

@nixpulvis
Copy link

Maybe use an inclusive range to be more clear?

@bmusin
Copy link
Contributor Author

bmusin commented Jan 10, 2018

@nixpulvis, you mean 0..10?

@nixpulvis
Copy link

Nope, though now that I'm playing with it it looks like it's experamental and kinda a mess imho, see #28237.

Inclusive ranges (in this context) include the last element as well as the rest.

@nixpulvis
Copy link

I would however strongly encourage a change to 0..10, since it's helpful to have the same number in the description and the code.

@varkor
Copy link
Member

varkor commented Jan 11, 2018

This change is now incorrect. The documentation says:

Let's write the numbers one through ten to a [TcpStream]:

The code now writes the numbers from zero through nine. You should add one to i in each case. (This will be cleaner with the inclusive range syntax, but as it's not stabilised yet, it's best not to include it.)

@bmusin
Copy link
Contributor Author

bmusin commented Jan 11, 2018

@varkor, you meant this?

@nixpulvis
Copy link

@varkor oh nice catch, I should have read the docs more carefully before suggesting 0..10. Still I think this looks the best.

@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 13, 2018
@shepmaster
Copy link
Member

Looks great @bmusin! Please go ahead and squash these commits and we will be good to merge!

@bmusin
Copy link
Contributor Author

bmusin commented Jan 13, 2018

Squashed.

@shepmaster
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 13, 2018

📌 Commit cee295e has been approved by shepmaster

@shepmaster shepmaster added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 14, 2018
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 14, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jan 15, 2018
bors added a commit that referenced this pull request Jan 15, 2018
Rollup of 10 pull requests

- Successful merges: #47120, #47126, #47277, #47330, #47368, #47372, #47414, #47417, #47432, #47443
- Failed merges: #47334
@bors bors merged commit cee295e into rust-lang:master Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants