From 98d0aae9a1a427e299f281917ad3f387dbd675f2 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Tue, 21 Aug 2012 17:02:40 -0700 Subject: [PATCH] Fix some map related build failures. --- src/libstd/map.rs | 5 +---- src/test/run-pass/class-impl-very-parameterized-trait.rs | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/libstd/map.rs b/src/libstd/map.rs index 538a6446001..3056b6b938a 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -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); diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index 43c3315577f..60762ee26b5 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -59,12 +59,12 @@ fn find(+k:int) -> option { if k <= self.meows { else { none } } - fn remove(+k:int) -> option { + fn remove(+k:int) -> bool { match self.find(k) { some(x) => { - self.meows -= k; some(x) + self.meows -= k; true } - none => { none } + none => { false } } }