

Swift: How to make single-character Strings work in a UInt8 raw value enum - icodestuff
https://gist.github.com/danhd123/c1dc8242f48ace176cf8

======
icodestuff
The motivation for this was trying to parse a binary file with a discriminated
union, with the tag being a single byte representing one of several ASCII
characters. Since Swift doesn't have single byte character literals like
single-quoted characters in C, UInt8 raw value enums required decimal or
hexadecimal integer literals, which really hurts readability; 0x42 is strictly
worse than 'B'. As a StringLiteralConvertible, "B" is an acceptable value for
a UInt8 case.

