Open
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.
Activity