rust
rust copied to clipboard
add swap method to the Map trait
Like insert, but returning the value that was replaced if applicable.
A function along the lines of fn update(&mut self, key: K, f: fn(V)->V) to mutate a value in place would also be helpful
@14427: #5528 adds a find_mut method which is quite similar
Closed in #6236