The first three all take &mut self while indexmap takes self by value. Is this intentional? I found this makes it complicated for a library to multiplex across different choices of underlying map type: serde-rs/json#418.
My workaround is:
mem::replace(occupied_entry.get_mut(), value)