diff --git a/src/libcore/option.rs b/src/libcore/option.rs index b97e5950f19..6e8e5567756 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -136,7 +136,7 @@ impl extensions for option { Fails if the value equals `none` "] - pure fn expect(reason: str) -> T { expect(self, reason) } + pure fn expect(reason: str) -> T { expect(self, reason) } } #[test] diff --git a/src/libstd/map.rs b/src/libstd/map.rs index 6163f6154a1..ddcf15257e0 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -232,11 +232,11 @@ mod chained { } fn get(k: K) -> V { - option::get(self.find(k)) + self.find(k).expect("Key not found in table") } fn [](k: K) -> V { - option::get(self.find(k)) + self.get(k) } fn remove(k: K) -> option {