2013-01-23 20:15:06 -06:00
|
|
|
fn g(x: &Option<int>) {
|
2013-08-03 18:59:24 -05:00
|
|
|
println(x.unwrap().to_str());
|
2013-01-23 20:15:06 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn f(x: &mut Option<int>) {
|
|
|
|
g(&*x);
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2013-01-23 20:15:06 -06:00
|
|
|
let mut x = ~Some(3);
|
|
|
|
f(x);
|
|
|
|
}
|