Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing fixed sized arrays #36

Closed
mikhailOK opened this issue Oct 25, 2019 · 5 comments
Closed

Serializing fixed sized arrays #36

mikhailOK opened this issue Oct 25, 2019 · 5 comments

Comments

@mikhailOK
Copy link
Contributor

After #33 borsh can serialize fixed sized arrays of any type, but deserialize only byte arrays.
That's inconsistent

@MaksymZavershynskyi
Copy link
Contributor

Since there is no trait specialization available in stable Rust we should only implement serializer/deserializer for standard types. So the solution to this issue is to remove serialization of non-primitive arrays and add serializers for primitive arrays.

We should also further investigate how bincode and serder address this issue. Assigning to @fckt

@jsoneaday
Copy link

Do you guys have a sample of deserializing an array of some type?

@nonergodic
Copy link

Any update on this?

@nonergodic
Copy link

Hah, just read the code and found that it was actually implemented with 0.9.1 release... i.e. 6 days ago!

just had to update my cargo.toml dependency to:
borsh = { version = "0.9.1", features = ["const-generics"] }
and now things work ❤️

@bowenwang1996
Copy link
Contributor

So looks like this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants