Skip to content

Commit

Permalink
Merge pull request #634 from Veykril/veykril/push-psprrykkzwvo
Browse files Browse the repository at this point in the history
Fix `Lookup<Vec<T>>` impls
  • Loading branch information
Veykril authored Dec 18, 2024
2 parents 3c7f169 + f04d645 commit 803d4a0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/interned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,7 @@ impl Lookup<String> for &str {

impl<A: Hash + Eq + PartialEq<T> + Clone + Lookup<T>, T> Lookup<Vec<T>> for &[A] {
fn hash<H: Hasher>(&self, h: &mut H) {
for a in *self {
Hash::hash(a, h);
}
Hash::hash(self, h);
}

fn eq(&self, data: &Vec<T>) -> bool {
Expand All @@ -410,9 +408,7 @@ impl<A: Hash + Eq + PartialEq<T> + Clone + Lookup<T>, T> Lookup<Vec<T>> for &[A]

impl<const N: usize, A: Hash + Eq + PartialEq<T> + Clone + Lookup<T>, T> Lookup<Vec<T>> for [A; N] {
fn hash<H: Hasher>(&self, h: &mut H) {
for a in self {
Hash::hash(a, h);
}
Hash::hash(self, h);
}

fn eq(&self, data: &Vec<T>) -> bool {
Expand Down

0 comments on commit 803d4a0

Please sign in to comment.