Hacker News new | ask | show | jobs
by nicoburns 2037 days ago
It's a switch statement that's an expression. That's a nice ergonomic improvement when you want to assign the result to a variable. Especially as it allows you to use a non-mutable variable whereas otherwise you'd have to make it mutable.
1 comments

I wouldn't compare it to a switch statement, because a switch statement - even though it looks similar - has fundamentally different control flow.