mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-25 10:31:12 +00:00
32 lines
592 B
Rust
32 lines
592 B
Rust
![]() |
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);
|
||
|
}
|
||
|
}
|