mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
10 lines
193 B
Rust
10 lines
193 B
Rust
fn destructure(x: Option<isize>) -> isize {
|
|
match x {
|
|
None => 0,
|
|
Some(ref mut v) => *v //~ ERROR cannot borrow
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(destructure(Some(22)), 22);
|
|
}
|