From 83270d2d792fb519481f6df87f23d73c767ec5f9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 7 Feb 2013 17:49:57 -0500 Subject: rm each method from the Map trait the map types should implement BaseIter instead --- src/libstd/smallintmap.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/libstd/smallintmap.rs') 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 SmallIntMap: Map { 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 SmallIntMap { /// Create an empty SmallIntMap static pure fn new() -> SmallIntMap { 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") } -- cgit 1.4.1-3-g733a5