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

Implemented serde_derive for enums #60

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

piniom
Copy link
Collaborator

@piniom piniom commented Sep 30, 2024

No description provided.

@piniom piniom mentioned this pull request Sep 30, 2024
Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Examples are great, adding some tests for the CI like for the structs, and let's merge! 🚀

return Ok(#deserialize);
}
)*
Err(::cainome_cairo_serde::Error::Deserialize("Invalid variant Id".to_string()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Err(::cainome_cairo_serde::Error::Deserialize("Invalid variant Id".to_string()))
Err(::cainome_cairo_serde::Error::Deserialize(format!(
"Invalid variant Id `{}` deserializing {} at offset `{}`",
felt[offset - 1],
#ident,
offset - 1
)))

As we have the info, we should try to give more context in case this unlikely situation occurs. 👍

@piniom
Copy link
Collaborator Author

piniom commented Oct 1, 2024

@glihm tests added

@piniom piniom merged commit 330cc58 into feature/cairo-serde-derive Oct 1, 2024
glihm added a commit that referenced this pull request Oct 2, 2024
* basic impl

* clippy

* macros: changed some paths to absolute

* macros: made the serialized size to be always dynamic

* Implemented serde_derive for enums (#60)

* macros: Implemented serde_derive for enums

* clippy

* added derive tests

* fix: typo

---------

Co-authored-by: Szymon Wojtulewicz <szymon.wojtulewicz@gmail.com>
Co-authored-by: Szymon Wojtulewicz <58044978+piniom@users.noreply.github.com>
Co-authored-by: glihm <dev@glihm.net>
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

Successfully merging this pull request may close these issues.

2 participants