summary refs log tree commit diff
path: root/src/libstd/smallintmap.rs
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-02-07 17:49:57 -0500
committerDaniel Micay <danielmicay@gmail.com>2013-02-07 22:04:35 -0500
commit83270d2d792fb519481f6df87f23d73c767ec5f9 (patch)
tree89b8242df68a8a249291c6a2b5354bc7de2f0bac /src/libstd/smallintmap.rs
parentd903231f1e7d7efb35405bdfdcbc451385e429b2 (diff)
downloadrust-83270d2d792fb519481f6df87f23d73c767ec5f9.tar.gz
rust-83270d2d792fb519481f6df87f23d73c767ec5f9.zip
rm each method from the Map trait
the map types should implement BaseIter instead
Diffstat (limited to 'src/libstd/smallintmap.rs')
-rw-r--r--src/libstd/smallintmap.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/smallintmap.rs b/src/libstd/smallintmap.rs
index 9af596eb1f5..218964695e2 100644
--- a/src/libstd/smallintmap.rs
+++ b/src/libstd/smallintmap.rs
@@ -48,16 +48,6 @@ impl<V> SmallIntMap<V>: Map<uint, V> {
         self.find(key).is_some()
     }
 
-    /// Visit all key-value pairs
-    pure fn each(&self, it: fn(key: &uint, value: &V) -> bool) {
-        for uint::range(0, self.v.len()) |i| {
-            match self.v[i] {
-              Some(ref elt) => if !it(&i, elt) { break },
-              None => ()
-            }
-        }
-    }
-
     /// Visit all keys
     pure fn each_key(&self, blk: fn(key: &uint) -> bool) {
         self.each(|k, _| blk(k))
@@ -109,6 +99,16 @@ pub impl<V> SmallIntMap<V> {
     /// Create an empty SmallIntMap
     static pure fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
 
+    /// Visit all key-value pairs
+    pure fn each(&self, it: fn(key: &uint, value: &V) -> bool) {
+        for uint::range(0, self.v.len()) |i| {
+            match self.v[i] {
+              Some(ref elt) => if !it(&i, elt) { break },
+              None => ()
+            }
+        }
+    }
+
     pure fn get(&self, key: &uint) -> &self/V {
         self.find(key).expect("key not present")
     }