[Bug] bincode
deserialization fails for fixed-size byte arrays
#221
Labels
bug
Something isn't working
bincode
deserialization fails for fixed-size byte arrays
#221
Component
primitives
What version of Alloy are you on?
alloy-primitives v0.3.1
Operating System
None
Describe the bug
Trying to use
bincode
to deserializeFixedBytes<N>
fails becausedeserializer.deserialize_any
is not supported.Code snippet to reproduce this bug:
The
serde
documentation also discourages the use ofdeserialize_any
for this very reason:However, as I understand #202, JSON deserialization support for either a byte array, byte sequence, or string was explicitly required. Here I see a possible compromise to also check
is_human_readable()
in the deserialization and keep the current parsing only for human readable, e.g. JSON, and usedeserializer.deserialize_bytes
otherwise, which would also allowbincode
and similar formats.If this approach is acceptable, I would be happy to provide a PR.
The text was updated successfully, but these errors were encountered: