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

[Bug] Rust generation: Implement the serialize trait correctly for the TupleArray #60

Open
MathieuDutSik opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@MathieuDutSik
Copy link
Contributor

🐛 Bug

The serialize trait is not correctly implemented for generated code in rust.

To reproduce

The following code does not pass

Signature:
  NEWTYPESTRUCT:
    TUPLEARRAY:
      CONTENT: U8
      SIZE: 64

The generated rust code is

#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
pub struct Signature(pub [u8; 64]);

and it does not compile since there is no serialization/deserialization implementations for [u8; 64].

I think here

Expected Behavior

I think implementing the trait in the generated code is the way forward.

System information

The bug is generic.

Additional context

None.

@MathieuDutSik MathieuDutSik added the bug Something isn't working label Jan 6, 2025
@MathieuDutSik MathieuDutSik changed the title [Bug] Implement the serialize trait correctly for the TupleArray [Bug] Implement the serialize trait correctly for the TupleArray Jan 6, 2025
@ma2bd ma2bd changed the title [Bug] Implement the serialize trait correctly for the TupleArray [Bug] Rust generation: Implement the serialize trait correctly for the TupleArray Jan 6, 2025
@ma2bd
Copy link
Contributor

ma2bd commented Jan 6, 2025

I suppose we could insert this solution:
https://crates.io/crates/serde-big-array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants