To address your other point
However, I think this would only be worth it, if it would allow bindings [...]
My RFC contains the line "I find it useful when I want to use an if-let statement without actually binding anything" as a direct argument for using matches!
when you don't want to contend with if-let yoda syntax:
let x = 42;
if let 42 = x {
/* do something */
}
I prepared an argument to defend separating the syntaxes :
Unfortunately it derives that using
matches!
for binding will lead to an uno reverse-reverse and not only cause yoda syntax, but cause yoda syntax in the much more common case
However I think arrow syntax actually makes this work
let myvar = Some(42);
if myvar => Some(x) {
/* do something with x */
}
Thoughts?