mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
11 lines
193 B
Rust
11 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);
|
|
}
|