Hashmap Entry Insert

September 2020 —

Pitch

Someone in the community discord wanted a feature and I was like “hey, why not try to implement it, that could be fun” (based on an existing but obsoleted PR).

impl<'a, K, V> Entry<'a, K, V> {
    pub fn insert(self, value: V) -> OccupiedEntry<'a, K, V> {…}
}

Media

Outcome

Currently implemented behind the #![feature(entry_insert)] flag.

Future

The library team has approved it for stabilisation, pending some minor changes. I will get to that… soonish.