dirty_scope.rs 389 B

123456789101112131415161718192021
  1. use std::hash::Hash;
  2. use crate::ScopeId;
  3. #[derive(Debug, Clone, Eq, PartialOrd, Ord)]
  4. pub struct DirtyScope {
  5. pub height: u32,
  6. pub id: ScopeId,
  7. }
  8. impl PartialEq for DirtyScope {
  9. fn eq(&self, other: &Self) -> bool {
  10. self.id == other.id
  11. }
  12. }
  13. impl Hash for DirtyScope {
  14. fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
  15. self.id.hash(state);
  16. }
  17. }