about summary refs log tree commit diff
path: root/src/libcore/trie.rs
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-03-24 20:40:17 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-03-24 21:40:16 -0400
commit38f39ac540d2a8b42c650e3aae9eaa715d47c554 (patch)
tree4c21510053d0949fdccd721272416da9b4f5adda /src/libcore/trie.rs
parentf0f4a00e88fc374b2b3096789a11bf429d42c3a9 (diff)
downloadrust-38f39ac540d2a8b42c650e3aae9eaa715d47c554.tar.gz
rust-38f39ac540d2a8b42c650e3aae9eaa715d47c554.zip
expose find_mut in the Map trait
Diffstat (limited to 'src/libcore/trie.rs')
-rw-r--r--src/libcore/trie.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcore/trie.rs b/src/libcore/trie.rs
index 007bafcd03d..5921ae5b3f5 100644
--- a/src/libcore/trie.rs
+++ b/src/libcore/trie.rs
@@ -111,6 +111,12 @@ impl<T> Map<uint, T> for TrieMap<T> {
         }
     }
 
+    /// Return a mutable reference to the value corresponding to the key
+    #[inline(always)]
+    fn find_mut(&mut self, key: &uint) -> Option<&'self mut T> {
+        find_mut(&mut self.root.children[chunk(*key, 0)], *key, 1)
+    }
+
     /// 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.
@@ -153,12 +159,6 @@ pub impl<T> TrieMap<T> {
     fn each_value_reverse(&self, f: &fn(&T) -> bool) {
         self.each_reverse(|&(_, v)| f(v))
     }
-
-    /// Return a mutable reference to the value corresponding to the key
-    #[inline(always)]
-    fn find_mut(&mut self, key: &uint) -> Option<&'self mut T> {
-        find_mut(&mut self.root.children[chunk(*key, 0)], *key, 1)
-    }
 }
 
 pub struct TrieSet {