Skip to content

Use std iterators for some collections #647

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 3 commits into from
May 20, 2025

Conversation

kylewlacy
Copy link
Contributor

This PR replaces the custom iterators for various collection types, to instead use the built-in iterators from std (or alloc). This applies to HashMap, HashSet, BTreeMap, and BTreeSet. In addition to simplifying the implementation, this also means we no longer need to .collect() for HashMap or HashSet when creating the iterator!

This was unblocked by #641 (previously, HashMap needed a custom iterator that buffered the keys in order to implement DoubleEndedIterator)

As part of this change, the iter vtable for HashMap no longer provides an next_back, while the iter vtable for BTreeSet now does provide it

@fasterthanlime
Copy link
Contributor

Awesome work there, thanks so much!

@fasterthanlime fasterthanlime merged commit d30d29a into facet-rs:main May 20, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants