treemap: add a find_mut method

This commit is contained in:
Daniel Micay 2013-03-24 16:55:51 -04:00
parent a56ec8c134
commit 7948149456
2 changed files with 38 additions and 4 deletions

View file

@ -38,9 +38,12 @@ pub trait Map<K, V>: Mutable {
/// Iterate over the map and mutate the contained values
fn mutate_values(&mut self, f: &fn(&K, &mut V) -> bool);
/// Return the value corresponding to the key in the map
/// Return a reference to the value corresponding to the key
fn find(&self, key: &K) -> Option<&'self V>;
/// Return a mutable reference to the value corresponding to the key
//fn find_mut(&mut self, key: &K) -> Option<&'self mut V>;
/// Insert a key-value pair into the map. An existing value for a
/// key is replaced by the new value. Return true if the key did
/// not already exist in the map.