Skip to content

derive Hash - #92

Merged
HEnquist merged 2 commits into
HEnquist:masterfrom
LastExceed:derive-hash
Nov 19, 2026
Merged

HEnquist merged 2 commits into
HEnquist:masterfrom
LastExceed:derive-hash

Conversation

@LastExceed

@LastExceed LastExceed commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

In my particular case I want to use one of the enums as a property in a struct that needs to be Hash (because of a trait bound), and I see no good reason not do derive Hash on simple enums

@HEnquist

Copy link
Copy Markdown
Owner

Thanks! Could you add a line to the PR description about what you need Hash for? Deriving is cheap, but I'd still like each derive to have a reason for existing.

Also, DisconnectReason now has Hash but not Eq, so it can't be used as a map key. Do you need it on that one?

@LastExceed

Copy link
Copy Markdown
Contributor Author

Done. I personally don't have a need for more derives on DisconnectReason in particular, but I have added them anyway for consistency, and because it seems needlessly restrictive to not have them

@HEnquist
HEnquist merged commit e58c465 into HEnquist:master Nov 19, 2026
3 checks passed
@HEnquist

Copy link
Copy Markdown
Owner

Thanks! I merged this, and made a follow-up in #93

This was referenced Nov 22, 2026
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