rust icon indicating copy to clipboard operation
rust copied to clipboard

add swap method to the Map trait

Open thestinger opened this issue 13 years ago • 3 comments

Like insert, but returning the value that was replaced if applicable.

thestinger avatar Mar 15 '13 01:03 thestinger

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 avatar Mar 19 '13 04:03 14427

@14427: #5528 adds a find_mut method which is quite similar

thestinger avatar Mar 25 '13 05:03 thestinger

Closed in #6236

alexcrichton avatar May 07 '13 15:05 alexcrichton