0ac7a219f0
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
13 lines
158 B
Rust
13 lines
158 B
Rust
fn g(x: &Option<int>) {
|
|
println(x.unwrap().to_str());
|
|
}
|
|
|
|
fn f(x: &mut Option<int>) {
|
|
g(&*x);
|
|
}
|
|
|
|
pub fn main() {
|
|
let mut x = ~Some(3);
|
|
f(x);
|
|
}
|