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

Feature request: Retain Iterator #11

Closed
Popog opened this issue Nov 15, 2016 · 4 comments
Closed

Feature request: Retain Iterator #11

Popog opened this issue Nov 15, 2016 · 4 comments

Comments

@Popog
Copy link

Popog commented Nov 15, 2016

Have retain return a iterator over the extracted values, similar to Drain in the standard library, or my PreRFC.

It seems like a relatively simple change, so if you're interested I could probably get it done and shoot you a PR later this week.

@bluss
Copy link
Member

bluss commented Nov 15, 2016

Since this is in the interest of demoing it for libstd, it makes sense. It's not good if we have an iterator that doesn't adhere to the element order of the map, though.

Popog pushed a commit to Popog/ordermap that referenced this issue Nov 15, 2016
.retain() now returns an iterator with the removed items
closes indexmap-rs#11
Popog pushed a commit to Popog/ordermap that referenced this issue Nov 15, 2016
.retain() now returns an iterator with the removed items
closes indexmap-rs#11
Also cleaned up some match statements.
@Popog Popog mentioned this issue Nov 15, 2016
@bluss
Copy link
Member

bluss commented Sep 11, 2017

Removing the breaking label because retain() should stay as it is (compatible with HashMap), but we can add new methods.

@cuviper
Copy link
Member

cuviper commented Dec 15, 2020

The current equivalent in std would be HashMap::drain_filter, but this hasn't been stabilized yet.

@cuviper
Copy link
Member

cuviper commented Nov 18, 2022

We'll let #242 track drain_filter.

@cuviper cuviper closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants