container: remove internal iterators from Map
the maps are being migrated to external iterators
This commit is contained in:
parent
5242e8d2ba
commit
64ee9668a2
6 changed files with 104 additions and 137 deletions
|
|
@ -61,29 +61,8 @@ impl<T> Mutable for cat<T> {
|
|||
}
|
||||
|
||||
impl<T> Map<int, T> for cat<T> {
|
||||
fn each<'a>(&'a self, f: &fn(&int, &'a T) -> bool) -> bool {
|
||||
let mut n = int::abs(self.meows);
|
||||
while n > 0 {
|
||||
if !f(&n, &self.name) { return false; }
|
||||
n -= 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
fn contains_key(&self, k: &int) -> bool { *k <= self.meows }
|
||||
|
||||
fn each_key(&self, f: &fn(v: &int) -> bool) -> bool {
|
||||
self.each(|k, _| f(k))
|
||||
}
|
||||
|
||||
fn each_value<'a>(&'a self, f: &fn(v: &'a T) -> bool) -> bool {
|
||||
self.each(|_, v| f(v))
|
||||
}
|
||||
|
||||
fn mutate_values(&mut self, _f: &fn(&int, &mut T) -> bool) -> bool {
|
||||
fail!("nope")
|
||||
}
|
||||
|
||||
fn insert(&mut self, k: int, _: T) -> bool {
|
||||
self.meows += k;
|
||||
true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue