Skip to content

Improve code example for length comparison #84135

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

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Conversation

GuillaumeGomez
Copy link
Member

Small fix/improvement: it's much safer to check that you're under the length of an array rather than chacking that you're equal to it. It's even more true in case you update the length of the array while iterating.

@GuillaumeGomez GuillaumeGomez added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Apr 12, 2021
@rust-highfive
Copy link
Contributor

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 12, 2021
@kennytm
Copy link
Member

kennytm commented Apr 13, 2021

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 13, 2021

📌 Commit b89c464 has been approved by kennytm

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2021
@bors
Copy link
Collaborator

bors commented Apr 13, 2021

⌛ Testing commit b89c464 with merge 5c13042...

@bors
Copy link
Collaborator

bors commented Apr 13, 2021

☀️ Test successful - checks-actions
Approved by: kennytm
Pushing 5c13042 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 13, 2021
@bors bors merged commit 5c13042 into master Apr 13, 2021
@bors bors deleted the GuillaumeGomez-patch-1 branch April 13, 2021 16:44
@rustbot rustbot added this to the 1.53.0 milestone Apr 13, 2021
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 merged-by-bors This PR was explicitly merged by bors. 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.

5 participants