Closed NickCondron closed 1 year ago
I still don't feel like these belong in Peppi— I think apps will be opinionated in conflicting ways about how to fuzzily convert human inputs to characters, stages, etc.
And I would expect most apps to present these kinds of enums via drop-down lists, with selection-via-typing provided by the UI framework (and possibly augmented by a list of aliases for each option). That wouldn't use regexes at all, which IMO further diminishes the value of adding them to Peppi.
Ok. Fair enough.
I think separating regex matching away from the info module makes sense. They don't serve the same use case. ~It's a bit clunky, but I think putting the regexes for each type in the same module as the type itself is the simplest way to do things.~
All the code in this PR is behind an optional
regex_match
feature that is disabled by default. (Note: there is no standard convention for feature naming. Seems like either snake_case or kebab-case is used. Let me know if you want to change it).I removed some
try_from<&str>
functions because I don't think they serve a purpose anymore.I added a test, but it is mostly a proof of concept to see how the interface works. I wouldn't really be against removing it.