mozilla/rust — pull request #10547 by davidhalperin (2013-11-18 13:09:58+00:00)
Title: Map trait improvements

Add methods `find_or_insert`, `find_or_insert_with`, `insert_or_update_with` and `reserve_at_least` to the `MutableMap` trait.

Closes #5568.

The unsafe way of implementing `find_or_insert_with` on `TreeMap` mentioned in the issue discussion doesn't work after all. The way done here isn't great but it works at least. Someone can come up with a better implementation in the future but I don't think that should hold the rest of this up.