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

[docs] Drain filter pseudo code incorrect #44499

Closed
mystise opened this issue Sep 11, 2017 · 1 comment
Closed

[docs] Drain filter pseudo code incorrect #44499

mystise opened this issue Sep 11, 2017 · 1 comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@mystise
Copy link

mystise commented Sep 11, 2017

https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.drain_filter

It appears that i should not be incremented if a value is removed from the array, as that'll cause values to be skipped and perhaps out of bounds access (say if the last element is removed, i will be incremented and one past the end of the array will be accessed)

@mystise mystise changed the title Drain filter pseudo code incorrect [docs] Drain filter pseudo code incorrect Sep 11, 2017
@Gankra
Copy link
Contributor

Gankra commented Sep 12, 2017

Easy patch to start contributing with :)

@GuillaumeGomez GuillaumeGomez added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Sep 12, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 14, 2017
Fix drain_filter doctest.

Fixes rust-lang#44499.

Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Sep 15, 2017
Fix drain_filter doctest.

Fixes rust-lang#44499.

Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants