1
Fork 0

Replace most invocations of fail keyword with die! macro

This commit is contained in:
Nick Desaulniers 2013-01-31 17:51:01 -08:00 committed by Brian Anderson
parent 2db3175c76
commit aee7929469
331 changed files with 914 additions and 908 deletions

View file

@ -34,7 +34,7 @@ impl<T> Cell<T> {
/// Yields the value, failing if the cell is empty.
fn take() -> T {
if self.is_empty() {
fail ~"attempt to take an empty cell";
die!(~"attempt to take an empty cell");
}
let mut value = None;
@ -45,7 +45,7 @@ impl<T> Cell<T> {
/// Returns the value, failing if the cell is full.
fn put_back(value: T) {
if !self.is_empty() {
fail ~"attempt to put a value back into a full cell";
die!(~"attempt to put a value back into a full cell");
}
self.value = Some(move value);
}