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 the find_mut_equiv method to hashmap::HashMap #14968

Closed
wants to merge 1 commit into from
Closed

Add the find_mut_equiv method to hashmap::HashMap #14968

wants to merge 1 commit into from

Conversation

mneumann
Copy link
Contributor

This is a rebase of #11074.

Based on this commit:
rcatolino@12d9fd6

@alexcrichton
Copy link
Member

I understand this is requested often, but I'm not yet convinced that "add equiv copies of all methods" is the right approach to take here.

For previous discussion, see #13205, #11074, #11691, and #12135.

@thestinger
Copy link
Contributor

As I've stated a few times, Equiv is a bad interface for this because it's not actually general enough. Once the new closures land, the maps can simply expose methods taking a closure for equality comparisons (HashMap) or ordering comparisons (TreeMap). The convenience methods from the Map trait can then be implemented as a wrapper around these methods with zero overhead (unlike the closures of today). The Equiv trait can then simply be removed because it won't have a use case anymore.

@alexcrichton
Copy link
Member

Closing due to inactivity, but this is definitely a very real problem that needs a solution!

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.

3 participants