| David Tolnay | 7db7369 | 2019-10-20 14:51:12 -0400 | [diff] [blame] | 1 | use crate::syntax::{Ref, Ty1}; |
| 2 | use std::hash::{Hash, Hasher}; |
| 3 | |
| 4 | impl Eq for Ty1 {} |
| 5 | |
| 6 | impl PartialEq for Ty1 { |
| 7 | fn eq(&self, other: &Ty1) -> bool { |
| 8 | self.name == other.name && self.inner == other.inner |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | impl Hash for Ty1 { |
| 13 | fn hash<H: Hasher>(&self, state: &mut H) { |
| 14 | self.name.hash(state); |
| 15 | self.inner.hash(state); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | impl Eq for Ref {} |
| 20 | |
| 21 | impl PartialEq for Ref { |
| 22 | fn eq(&self, other: &Ref) -> bool { |
| 23 | self.inner == other.inner |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | impl Hash for Ref { |
| 28 | fn hash<H: Hasher>(&self, state: &mut H) { |
| 29 | self.inner.hash(state); |
| 30 | } |
| 31 | } |