Skip to content

Commit

Permalink
Merge pull request #671 from Veykril/veykril/push-vowtzoxmkqtq
Browse files Browse the repository at this point in the history
Impl `HashEqLike<T>` for `&T`
  • Loading branch information
Veykril authored Feb 5, 2025
2 parents ca9fba4 + 73a353c commit acd842a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/interned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,19 @@ where
}
}

impl<T> HashEqLike<T> for &T
where
T: Hash + Eq,
{
fn hash<H: Hasher>(&self, h: &mut H) {
Hash::hash(*self, &mut *h);
}

fn eq(&self, data: &T) -> bool {
**self == *data
}
}

impl<T> Lookup<T> for &T
where
T: Clone,
Expand Down

0 comments on commit acd842a

Please sign in to comment.