feat: implement Hash trait for structs that has implemented PartialEq/Eq#143
Closed
leiysky wants to merge 1 commit intoBurntSushi:masterfrom
Closed
feat: implement Hash trait for structs that has implemented PartialEq/Eq#143leiysky wants to merge 1 commit intoBurntSushi:masterfrom
leiysky wants to merge 1 commit intoBurntSushi:masterfrom
Conversation
Owner
|
#32 probably means we're getting rid of Eq on Span, so I would hold off adding Hash to it. |
Contributor
Author
Sure, what about the rest part?
|
BurntSushi
approved these changes
Nov 30, 2024
BurntSushi
pushed a commit
that referenced
this pull request
Nov 30, 2024
This mostly implements `Hash` for all types that also implement `PartialEq` and `Eq`, but notably omits one for `Span`. The reason being that I'm currently planning on removing the `PartialEq` and `Eq` implementations of `Span`, so I'd prefer not to add more API surface area that relies on it. Closes #143
Contributor
|
@BurntSushi may we have a new release with this patch included? I have a downstream project need it :P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of the core structs(e.g.
Duration,Time) has implementedHashtrait while some of them hasn't.This pull request implements
Hashtrait for the rest of the structs that should have implemented it(which arePartialEqandEq).