Open vilgotf opened 3 years ago
Thanks for the report. I think I may have initially overlooked the ser/de codepath, which resulted in this mixup.
Taking a step back here and thinking aloud, to what format should this type encode/decode to? The original C type is a union of byte-slices, but going in that direction doesn't sound very ergonomic. Trying to retro-guess myself, I think that here I originally wanted to go in the direction of https://en.wikipedia.org/wiki/Universally_unique_identifier#Format. If so, it needs to be stated explicitly and enforced by tests, as you highlighted.
Adding the following test shows it clearly:
I'm working on a fix which will serialize compact to
Token::Tuple
which should be fine since the code is already broken