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

Document custom representations and endianness #41

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

mkroening
Copy link
Contributor

I see you have already renamed inner to repr and added them to the list of bitfield parameters in 204f655. Thanks!

I am not sure if you are fine with referring to the endian-num crate here or if the examples should be standalone. I can remove any mention of the endian-num crate if you want me to. The alternative to using endian-num would be:

#[bitfield(u16, repr = u16, from = u16::to_be, into = u16::from_be)]
// instead of 
#[bitfield(u16, repr = be16, from = be16::from_ne, into = be16::to_ne)]

and then using to_ne_bytes() instead of to_be_bytes().

@wrenger
Copy link
Owner

wrenger commented Jun 4, 2024

As this is only a dev-dependency and a nice example, I would say it's ok. Thanks 👍🏻

@wrenger wrenger merged commit ed3b3be into wrenger:main Jun 4, 2024
3 checks passed
@mkroening mkroening deleted the repr-docs branch June 4, 2024 17:14
@mkroening
Copy link
Contributor Author

Could you publish a new release containing the new repr attribute option? :)

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