The following snippet returns the default value, if the key is not present:
some_map.entry(key)
.and_modify(modifier_fn)
.or_default();
I want modifier_fn
to be applied to the default value. I can achieve it like this:
some_map.entry(key)
.or_default();
some_map.entry(key)
.and_modify(modifier_fn);
but is there a more concise way, that calls some_map.entry(key)
only once?