You can use irrefutable patterns, but that’s not quite the same thing. It’s been discussed but there’s not consensus that it’s worth it
-
-
It would mostly just be a nice to have feature to cut back repetitive typing. I often copy and paste match statements over and over, where as if you pattern matched on the function you'd write the pattern once and then just invoke it.
-
Eg. You have a method thats defined twice one takes Result::Ok and the other takes Result::Error, and you just pass any result. The compiler knows the possible types that can be passed, but you don't have to match each time you want to pass a result to it
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.