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 Clone for FxHasher #16

Merged
merged 1 commit into from
Jan 13, 2024
Merged

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Apr 22, 2021

Other common Hasher implementations, including DefaultHasher and SipHasher, implement Clone—but FxHasher does not.

This is useful when a partially constructed hash can continue to be constructed in different ways. For example, when the hash of a leaf in a tree structure is determined by its path from the root: it can be unnecessarily expensive to independently hash the whole path for each leaf, as one can instead traverse the tree extending the hash of the parent node as one descends.

closes #23

Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable, thanks!

@Noratrieb Noratrieb merged commit f3bcd3f into rust-lang:master Jan 13, 2024
@eggyal eggyal deleted the derive-clone branch January 14, 2024 23:00
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.

Consider deriving Clone for FxHasher
2 participants