refactor: get rid of default implementation of Hashed trait for writable things #2573
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.
This supersedes #2549 as an approach to refactor the Hashed trait. See #2549 for discussion on why this should be done.
For any struct which implements
DefaultHashable
, it automatically derives the Hashed trait.We no longer have
hash_with
in the Hashed trait as it was only used by Hash, and there was no sane implementation for some implementations.The only downside is we can no longer put things which are just
Hashed
into a PMMR, as we don't have tuple derivations forHashed
. If this becomes a need in the future, something can be figured out.In future work, I would still like to rename the trait and it's functions, but it is not done here for minimal diff.