Camel case the option type
This commit is contained in:
parent
d9a6a63653
commit
8337fa1a54
330 changed files with 4929 additions and 4926 deletions
|
@ -3,16 +3,16 @@
|
|||
/// Similar to a mutable option type, but friendlier.
|
||||
|
||||
struct Cell<T> {
|
||||
mut value: option<T>;
|
||||
mut value: Option<T>;
|
||||
}
|
||||
|
||||
/// Creates a new full cell with the given value.
|
||||
fn Cell<T>(+value: T) -> Cell<T> {
|
||||
Cell { value: some(move value) }
|
||||
Cell { value: Some(move value) }
|
||||
}
|
||||
|
||||
fn empty_cell<T>() -> Cell<T> {
|
||||
Cell { value: none }
|
||||
Cell { value: None }
|
||||
}
|
||||
|
||||
impl<T> Cell<T> {
|
||||
|
@ -22,7 +22,7 @@ impl<T> Cell<T> {
|
|||
fail ~"attempt to take an empty cell";
|
||||
}
|
||||
|
||||
let mut value = none;
|
||||
let mut value = None;
|
||||
value <-> self.value;
|
||||
return option::unwrap(value);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ impl<T> Cell<T> {
|
|||
if !self.is_empty() {
|
||||
fail ~"attempt to put a value back into a full cell";
|
||||
}
|
||||
self.value = some(move value);
|
||||
self.value = Some(move value);
|
||||
}
|
||||
|
||||
/// Returns true if the cell is empty and false if the cell is full.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue