icu4x
icu4x copied to clipboard
Always use discriminant in ZeroTrie Serde; use serialize_bytes consistently
Fixes #4562
There are diffs; good to get this into 1.5
I scope-creeped a little bit and added more rmp-serde tests. I eyeballed all the custom Serialize impls in the project and added some tests on ones that looked important or suspicious. I found and fixed 1 other instance where we were using serialize_seq with deserialize_bytes.
Note: if you don't want me to serialize the whole thing as bytes, one potential alternative is that I could serialize a single u8 followed by bytes.
Note: if you don't want me to serialize the whole thing as bytes, one potential alternative is that I could serialize a single
u8followed by bytes.
^ Do you think doing it this way, with a separate entry encoding the discriminant, might be superior?
Yes I think it would be.
Ok coming right up
ok I have it implemented, but there's a stable key time_zone/iana_to_bcp47@1 that uses ZeroTrie and therefore the old format. I want to get rid of ZeroTrie and stick with just the variants (#4408) so I'm inclined to still use the new serialization format for the variants if we think it's superior.