mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +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);
|
|
}
|