DavidArno / SuccincT

Discriminated unions, pattern matching and partial applications for C#
MIT License
267 stars 15 forks source link

Change enum parsers to use Enum generic constraint #64

Closed DavidArno closed 4 years ago

DavidArno commented 4 years ago

Currently, TryParseEnum<T>(this string source) and TryParseEnumIgnoringCase<T>(this string source) use the constraint of struct and then test to see if an enum is supplied.

Update these to use the struct, Enum constraint instead to remove the need for a check.

DavidArno commented 4 years ago

Done.