-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.
Description
Sometimes I have a key type which implements Clone, but for efficiency reasons I don't want to clone it unless it's absolutely necessary.
In this case it would be nice to have a method
my_hash_map.entry_or_clone(&k)
which behaves identically to
my_hash_map.entry(k.clone())
but only bothers to clone k if the key doesn't already exist in my_hash_map.
orlp, ricochet1k, paul-tcell, Dushistov, athre0z and 25 more
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.