Closed VianneyRuhlmann closed 3 days ago
Attention: Patch coverage is 92.85714%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 70.54%. Comparing base (
d339c64
) to head (623b957
).
Benchmark execution time: 2024-11-27 12:21:51
Comparing candidate commit 623b957f in PR branch vianney/tiny-bytes/fix-hash
with baseline commit d339c64a in branch main
.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 51 metrics, 2 unstable metrics.
Omitted due to size.
What does this PR do?
BytesString
derives Hash fromBytes
which hashes the string as a &[u8]. BytesString also implementsBorrow<str>
which requires both types to have the same hash. The issue is that[u8]
andstr
do not have compatible hash functions, so BytesString should usestr
hash implementation.This PR also adds:
String
and'static str
to avoid utf8 checksAsRef<str>
trait useful when dealing with generic functionsSelf
type to matchBytes
styleMotivation
Hash is required to handle
meta
hashmap in spansAdditional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.