Merge pull request #634 from Veykril/veykril/push-psprrykkzwvo

Fix `Lookup<Vec<T>>` impls
This commit is contained in:
Lukas Wirth 2024-12-18 16:19:43 +00:00 committed by GitHub
commit 803d4a0714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {
@ -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 {