3 ms·
> Pattern matching is much, much cleaner than a switch with the branches extracted in separate functions I don't think that's what is being suggested. I think
by jjnoakes 9y ago
> Pattern matching is much, much cleaner than a switch with the branches extracted in separate functions
I don't think that's what is being suggested. I think the suggestion is to move the entire switch statement to a separate function, use 'return' in the switch cases, and have the caller assign the variable once, from the return value of the function.