From 13f666a72468ad20d5145ff5d618ef31c479c1a2 Mon Sep 17 00:00:00 2001 From: blake2-ppc Date: Fri, 21 Jun 2013 17:05:29 +0200 Subject: [PATCH] std::hashmap: Remove BaseIter impl for HashSet Remove the BaseIter impl, while keeping the .each method until callers are converted. --- src/libstd/hashmap.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs index dddda60702aa..0b6bf339d7ef 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 { priv map: HashMap } -impl BaseIter for HashSet { - /// Visit all values in order - fn each(&self, f: &fn(&T) -> bool) -> bool { self.map.each_key(f) } - fn size_hint(&self) -> Option { Some(self.len()) } -} - impl Eq for HashSet { fn eq(&self, other: &HashSet) -> bool { self.map == other.map } fn ne(&self, other: &HashSet) -> bool { self.map != other.map } @@ -725,6 +718,12 @@ impl HashSet { 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> {