Rewriting to use match as an expression.