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

replace most internal iterators with external iterators #6978

Closed
thestinger opened this issue Jun 6, 2013 · 3 comments
Closed

replace most internal iterators with external iterators #6978

thestinger opened this issue Jun 6, 2013 · 3 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@thestinger
Copy link
Contributor

The only reason to prefer internal iterators is the difficulty of implementing an external one for recursive data types and often for mutable iterators. We can still provide adaptors for composing internal iterators (iter.rs) but there's no need to provide internal iterators ourselves side-by-side with external iterators.

I think we should throw out the dozens of internal iterators we have on str and vec since they already have a mutable and immutable external iterator. We just need iterators for reverse traversal and the internal ones will be entirely redundant.

For example, there's no need for hardcoded internal iterators like each2 when we have xs.zip(ys) for any two arbitrary iterators - not just two vectors.

See: https://mail.mozilla.org/pipermail/rust-dev/2013-June/004364.html

@thestinger
Copy link
Contributor Author

Nominating for the backwards compatible milestone, This involves major API upheaval.

@thestinger
Copy link
Contributor Author

Lots of progress made on this! There are now more uses of external iterators than internal ones.

@thestinger
Copy link
Contributor Author

Closing this bug since the majority has been converted. I'll open specific bugs about the remaining tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

1 participant