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

encoding: Turn Hex into a proc macro #22

Open
kilpatty opened this issue Apr 3, 2020 · 0 comments
Open

encoding: Turn Hex into a proc macro #22

kilpatty opened this issue Apr 3, 2020 · 0 comments

Comments

@kilpatty
Copy link
Member

kilpatty commented Apr 3, 2020

We have implemented To/FromHex on most of our primitives as it makes that conversion much easier for our codebase, but it adds quite a bit of boilerplate code to all of those files. See here:
https://github.com/UrkelLabs/rsd/blob/master/primitives/src/headers.rs#L242-L254

Granted it is only 12 LoC, but if we turned To/FromHex into a proc macro, we could eliminate these entirely.

This should be a relatively straight forward conversion as pretty much every struct that implements it, does so in the same way.

I'll list any potential excepts in this issue.

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

1 participant