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

derive(ByteEq) #2274

Open
kupiakos opened this issue Jan 29, 2025 · 4 comments
Open

derive(ByteEq) #2274

kupiakos opened this issue Jan 29, 2025 · 4 comments
Labels
customer-request Documents customer requests.

Comments

@kupiakos
Copy link
Contributor

kupiakos commented Jan 29, 2025

Occasionally, replacing a derive(PartialEq) with a manual impl that compares the bytes of the types directly results in smaller code. A derive macro ByteEq would make this more ergonomic. This also applies to Hash. Inspired by bytemuck.

derive(ByteEq) should impl both PartialEq and Eq.

@kupiakos kupiakos added the customer-request Documents customer requests. label Jan 29, 2025
@jswrenn
Copy link
Collaborator

jswrenn commented Jan 29, 2025

@max-heller want to take a stab at this one, too?

@kupiakos
Copy link
Contributor Author

Alternative names: EqBytes and HashBytes

@jswrenn
Copy link
Collaborator

jswrenn commented Jan 29, 2025

We did just land derive(ByteHash) in #2159, and it's available in 0.8.14.

@kupiakos
Copy link
Contributor Author

kupiakos commented Jan 29, 2025

Oh, I somehow missed that due to an out-of-date docs.rs bookmark, thanks! 🤦‍♀

@kupiakos kupiakos changed the title derive(ByteEq, ByteHash) derive(ByteEq) Jan 29, 2025
@joshlf joshlf closed this as completed Jan 30, 2025
@joshlf joshlf reopened this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-request Documents customer requests.
Projects
None yet
Development

No branches or pull requests

3 participants