Use hash_stable for hashing str
This commit is contained in:
parent
d3848cb659
commit
c695b6026c
@ -377,9 +377,8 @@ fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
|
||||
|
||||
impl<CTX> HashStable<CTX> for str {
|
||||
#[inline]
|
||||
fn hash_stable(&self, _: &mut CTX, hasher: &mut StableHasher) {
|
||||
self.len().hash(hasher);
|
||||
self.as_bytes().hash(hasher);
|
||||
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
|
||||
self.as_bytes().hash_stable(ctx, hasher);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user