With the current implementation, nodes with the same type and contents have the same hash. But then in the Equatable implementation, we check for the same cmark_node. Therefore only Node instances for the same cmark_node can be used as the key in a dictionary or set, making the Hashable implementation more complicated than it needs to be.
With this change we also use the cmark_node for the Hashable implementation.
Alright, I added a changelog entry with 78c19c0, so this will be good to merge once the latest CI run passes. Thanks again for your help with this, @Lukas-Stuehrk!
With the current implementation, nodes with the same type and contents have the same hash. But then in the
Equatable
implementation, we check for the samecmark_node
. Therefore onlyNode
instances for the samecmark_node
can be used as the key in a dictionary or set, making theHashable
implementation more complicated than it needs to be.With this change we also use the
cmark_node
for theHashable
implementation.