beacon-biosignals / StableHashTraits.jl

Compute hashes over any Julia object simply and reproducibly
MIT License
9 stars 3 forks source link

Fix MethodError when hashing Pair #74

Closed rasmushenningsson closed 1 month ago

rasmushenningsson commented 1 month ago

Description

Before this PR, stable_hash(2=>3, HashVersion{4}()) fails with a MethodError. See https://github.com/beacon-biosignals/StableHashTraits.jl/issues/71

This PR fixes this by implementing internal_type_structure for Pair, which was needed since keytype and valuetype are not defined for Pair. It also adds unit tests.

This PR should not affect any benchmarks.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.57%. Comparing base (8d5f71c) to head (12d28fb). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #74 +/- ## ========================================== + Coverage 93.55% 93.57% +0.01% ========================================== Files 7 7 Lines 667 669 +2 ========================================== + Hits 624 626 +2 Misses 43 43 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.