by tOkeshu · 12y ago · 0 comments
So what about the following?:
match (width, margin_left, margin_right) {
(auto, _, _) => { ... }
(_, auto, auto) => { ... }
(_, auto, _) => { ... }
(_, _, auto) => { ... }
(_, _, _) => { ... }
}
Now that I write this, I can understand this style is trickier as the order here is critical.
The "debate" between `match` and `if` reminds me of the same one that exists in Erlang, where I saw people more often use `case of` with booleans instead of `if`.Moreover, is there any performance issue with matching auto for every tuple?