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

Add map and set extract_if #308

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Feb 3, 2024

No description provided.

@cuviper cuviper added the waiting-for-std Changes waiting for stabilization in the standard library, so we can match the API. label Feb 3, 2024
@cuviper cuviper linked an issue Feb 3, 2024 that may be closed by this pull request

if new_len != old_len {
// We don't keep track of *which* items were extracted, so reindex everything.
self.map.rebuild_hash_table();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it would be nice to reuse vec::ExtractIf, I haven't found a way to do this fixup for the indices afterward, because that vec::ExtractIf would be holding &mut on the entries, excluding even a raw pointer elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-std Changes waiting for stabilization in the standard library, so we can match the API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: extract_if
1 participant