icu4x
icu4x copied to clipboard
Always use discriminant marker in ZeroTrie serialized form
Currently the discriminant marker is only used in the ZeroTrie enum. It is not used in ZeroTrieSimpleAscii, etc. This is potentially error-prone since a ZeroTrie created from one type can be cast into another type with no way to detect the error in most cases until a debug assertion is hit. It would be safer to write out the discriminant in all cases even when the enum is not used. It also means it is easier to generalize from a specific type to a general type and vice-versa.
Should do after #4031 and before 1.5
Discuss with:
- @robertbastian
- @sffc
Optional:
- @Manishearth
Resolution: OK to do this if it impacts only Serde and is reasonably backwards compatible.