Skip to content

Commit

Permalink
Use hash_stable for hashing str
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Dec 20, 2021
1 parent d3848cb commit c695b60
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_data_structures/src/stable_hasher.rs
Expand Up @@ -377,9 +377,8 @@ impl<T: ?Sized + HashStable<CTX>, CTX> HashStable<CTX> for ::std::sync::Arc<T> {

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);
}
}

Expand Down

0 comments on commit c695b60

Please sign in to comment.