rust/src/test/run-pass/alt-ref-binding-mut-option.rs

9 lines
141 B
Rust
Raw Normal View History

fn main() {
2012-08-20 14:23:37 -05:00
let mut v = Some(22);
match v {
2012-08-20 14:23:37 -05:00
None => {}
Some(ref mut p) => { *p += 1; }
}
2012-08-20 14:23:37 -05:00
assert v == Some(23);
}