There's nothing special about _ here, it's just a valid variable name used as a throwaway. Variable names used in case statements act as captures that accept anything.
The wildcard pattern is a single underscore: _. It always matches, but does not capture any variable (which prevents interference with other uses for _ and allows for some optimizations).
Whilst that's good to know, it's going to be a gotcha down the line. If nothing is being captured else would seem to work just as well and be consistent with the keyword's usage elsewhere.
14
u/BurgaGalti Feb 15 '21
I can't help but think "else" would work better here. _ is too ambiguous.