cxx/syntax/impls.rs

32 lines
592 B
Rust
Raw Normal View History

2019-10-20 14:51:12 -04:00
use crate::syntax::{Ref, Ty1};
use std::hash::{Hash, Hasher};
impl Eq for Ty1 {}
impl PartialEq for Ty1 {
fn eq(&self, other: &Ty1) -> bool {
self.name == other.name && self.inner == other.inner
}
}
impl Hash for Ty1 {
fn hash<H: Hasher>(&self, state: &mut H) {
self.name.hash(state);
self.inner.hash(state);
}
}
impl Eq for Ref {}
impl PartialEq for Ref {
fn eq(&self, other: &Ref) -> bool {
self.inner == other.inner
}
}
impl Hash for Ref {
fn hash<H: Hasher>(&self, state: &mut H) {
self.inner.hash(state);
}
}