Replace most invocations of fail keyword with die! macro
This commit is contained in:
parent
2db3175c76
commit
aee7929469
331 changed files with 914 additions and 908 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue