Skip to content

Commit 13f666a

Browse files
blake2-ppcthestinger
blake2-ppc
authored andcommitted
std::hashmap: Remove BaseIter impl for HashSet
Remove the BaseIter impl, while keeping the .each method until callers are converted.
1 parent f045210 commit 13f666a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/libstd/hashmap.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use container::{Container, Mutable, Map, Set};
1919
use cmp::{Eq, Equiv};
2020
use hash::Hash;
21-
use old_iter::BaseIter;
2221
use iterator::{Iterator, IteratorUtil};
2322
use option::{None, Option, Some};
2423
use rand::RngUtil;
@@ -622,12 +621,6 @@ pub struct HashSet<T> {
622621
priv map: HashMap<T, ()>
623622
}
624623

625-
impl<T:Hash + Eq> BaseIter<T> for HashSet<T> {
626-
/// Visit all values in order
627-
fn each(&self, f: &fn(&T) -> bool) -> bool { self.map.each_key(f) }
628-
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
629-
}
630-
631624
impl<T:Hash + Eq> Eq for HashSet<T> {
632625
fn eq(&self, other: &HashSet<T>) -> bool { self.map == other.map }
633626
fn ne(&self, other: &HashSet<T>) -> bool { self.map != other.map }
@@ -725,6 +718,12 @@ impl<T:Hash + Eq> HashSet<T> {
725718
self.map.contains_key_equiv(value)
726719
}
727720

721+
/// Visit all elements in arbitrary order
722+
/// FIXME: Remove when all callers are converted
723+
pub fn each(&self, f: &fn(&T) -> bool) -> bool {
724+
self.iter().advance(f)
725+
}
726+
728727
/// An iterator visiting all elements in arbitrary order.
729728
/// Iterator element type is &'a T.
730729
pub fn iter<'a>(&'a self) -> HashSetIterator<'a, T> {

0 commit comments

Comments
 (0)