Open MStarha opened 11 months ago
Hey @MStarha, could you please provide some kind of github repo or gist with a minimal reproduction case showing this behavior?
Since posting I switched to ciborium and the issue went away. I am now very strapped for time and cannot make an example. I'll try to remember later.
I have an enum with many variants with variable sizes. If there is 72 variants and fewer and I pass invalid bytes to the deserializer, it correctly reports the data cannot be deserialized. However, if there are more than 72 variants and I pass invalid bytes, the deserializer returns the 73rd enum variant regardless of how many variants there are or what the variant contains.
I cannot say whether the mistake is in serde or postcard because I cannot get to the derived implementation of
Deserialize
for my enum.Is there anything I can do? Maybe use flavors?
I know 70+ variants is a lot, those are commands my application can receive and react to. I do not think I can realistically reduce the number. I am not sure that any of my code can help here.
Thank you.