rust/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs
Marvin Löbel 0ac7a219f0 Updated std::Option, std::Either and std::Result
- 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
2013-08-05 22:42:21 +02:00

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);
}