wscript: pattern matching
match is an expression, exhaustiveness-checked at compile time; guards, or-patterns, if-let and let-else.
match is an expression, exhaustiveness-checked at compile time:
rust
match e Quit => false,
Key if c == 'q' => false, // guards (don't count for exhaustiveness)
Key | Key => help, // or-patterns (no bindings inside, v1)
Key => true,
Click => x >= 0 && y >= 0,
}
if let Some(x) = opt { … } and let Some(n) = expr else { return Err("…") } work as in Rust (the let-else block must diverge).