mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 16:45:37 +00:00
18 lines
302 B
Rust
18 lines
302 B
Rust
//@ run-pass
|
|
// issue #89688
|
|
|
|
|
|
|
|
fn example_let_else(value: Option<String>) {
|
|
let Some(inner) = value else {
|
|
println!("other: {:?}", value); // OK
|
|
return;
|
|
};
|
|
println!("inner: {}", inner);
|
|
}
|
|
|
|
fn main() {
|
|
example_let_else(Some("foo".into()));
|
|
example_let_else(None);
|
|
}
|