Skip to content

Conversation

@willothy
Copy link

WIP

Adds a method to drain the map with an iterator.

Needs more testing (what happens with deletions while iterating, etc.)

I also think the resize logic is probably wrong because it could maybe lead to elements being seen twice

@ibraheemdev
Copy link
Owner

Hmm this seems tricky to implement concurrently. I think you would have to block for individual elements to complete to avoid yielding them twice. What's your use case?

@willothy
Copy link
Author

Yeah, definitely tricky. Still thinking it through, hence the draft status. Use case is removing and collecting all keys into a Vec. Currently just using .iter().collect() and then .clear().

@ibraheemdev ibraheemdev added the feature New feature or request label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants