If Let Guards
This is RFC 2294 which is to be
stabilized soon: this feature enables if let in match guards.
#![allow(unused)]
fn main() {
match ui.wait_event() {
KeyPress(mod_, key, datum) if let Some(action) = intercept(mod_, key) => act(action, datum),
ev => accept!(ev),
}
}
Backlinks