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

Add formatting implementations for LowerHex and friends #85

Open
nimish opened this issue Oct 17, 2023 · 1 comment
Open

Add formatting implementations for LowerHex and friends #85

nimish opened this issue Oct 17, 2023 · 1 comment

Comments

@nimish
Copy link

nimish commented Oct 17, 2023

Since it's already possible to derive one for Binary, it'd make sense to allow for println("{:x}") and the other integer printing formatters. A workaround is to manually convert to the sized uint before printing but that's a little tedious.

@hecatia-elegua
Copy link
Owner

Feel free to implement.
You could even just extend it for you own use with a custom derive macro ending its name in Bits.
For structs, the LowerHex impl should just be fmt::LowerHex::fmt(&self.value.value, f).
Actually, wouldn't a "normal" byte based derive LowerHex work?

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

2 participants