Fix some map related build failures.

This commit is contained in:
Michael Sullivan 2012-08-21 17:02:40 -07:00
parent 7fe1005fd1
commit 98d0aae9a1
2 changed files with 4 additions and 7 deletions

View File

@ -733,10 +733,7 @@ fn hash(u: &uint) -> uint {
i = 0u;
while i < num_to_insert {
let v = hm.remove(i);
match v {
option::some(u) => assert (u == i * i),
option::none => fail
}
assert v;
i += 2u;
}
assert (hm.size() == num_to_insert / 2u);

View File

@ -59,12 +59,12 @@ fn find(+k:int) -> option<T> { if k <= self.meows {
else { none }
}
fn remove(+k:int) -> option<T> {
fn remove(+k:int) -> bool {
match self.find(k) {
some(x) => {
self.meows -= k; some(x)
self.meows -= k; true
}
none => { none }
none => { false }
}
}