about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorblake2-ppc <blake2-ppc>2013-06-21 17:05:29 +0200
committerDaniel Micay <danielmicay@gmail.com>2013-06-23 04:23:01 -0400
commit13f666a72468ad20d5145ff5d618ef31c479c1a2 (patch)
tree1b8d7a929ef4b1148d28da777f8a00d0170841b1 /src/libstd
parentf045210857a8936c7d6ce36a3029eac906dedc4e (diff)
downloadrust-13f666a72468ad20d5145ff5d618ef31c479c1a2.tar.gz
rust-13f666a72468ad20d5145ff5d618ef31c479c1a2.zip
std::hashmap: Remove BaseIter impl for HashSet
Remove the BaseIter impl, while keeping the .each method until callers
are converted.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/hashmap.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs
index dddda60702a..0b6bf339d7e 100644
--- a/src/libstd/hashmap.rs
+++ b/src/libstd/hashmap.rs
@@ -18,7 +18,6 @@
 use container::{Container, Mutable, Map, Set};
 use cmp::{Eq, Equiv};
 use hash::Hash;
-use old_iter::BaseIter;
 use iterator::{Iterator, IteratorUtil};
 use option::{None, Option, Some};
 use rand::RngUtil;
@@ -622,12 +621,6 @@ pub struct HashSet<T> {
     priv map: HashMap<T, ()>
 }
 
-impl<T:Hash + Eq> BaseIter<T> for HashSet<T> {
-    /// Visit all values in order
-    fn each(&self, f: &fn(&T) -> bool) -> bool { self.map.each_key(f) }
-    fn size_hint(&self) -> Option<uint> { Some(self.len()) }
-}
-
 impl<T:Hash + Eq> Eq for HashSet<T> {
     fn eq(&self, other: &HashSet<T>) -> bool { self.map == other.map }
     fn ne(&self, other: &HashSet<T>) -> bool { self.map != other.map }
@@ -725,6 +718,12 @@ impl<T:Hash + Eq> HashSet<T> {
       self.map.contains_key_equiv(value)
     }
 
+    /// Visit all elements in arbitrary order
+    /// FIXME: Remove when all callers are converted
+    pub fn each(&self, f: &fn(&T) -> bool) -> bool {
+        self.iter().advance(f)
+    }
+
     /// An iterator visiting all elements in arbitrary order.
     /// Iterator element type is &'a T.
     pub fn iter<'a>(&'a self) -> HashSetIterator<'a, T> {