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