Enum with `Substring` raw value?

Unless I'm missing something here, in order to hit a degenerate case here, you would have already needed to construct userInput from arbitrarily-long user input, meaning you've already spent arbitrarily long elsewhere, no? (You are validating user input, right? :wink:)

(I also can't think of an obvious use-case where user input would be passed in to an init(rawValue:), but maybe I'm not thinking hard enough.)

1 Like