feat: fix the scope rollover bug
This commit is contained in:
1 parent
e4d089fabc
commit
d4b6bb8a7b
17 files changed
+591
-360
No files matched your search
@@ -1,19 +1,21 @@
|
||||
use std::hash::Hash;
|
||||
|
||||
use crate::ScopeId;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, Eq, PartialOrd, Ord)]
|
||||
pub struct DirtyScope {
|
||||
pub height: u32,
|
||||
pub id: ScopeId,
|
||||
}
|
||||
|
||||
impl PartialOrd for DirtyScope {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
Some(self.height.cmp(&other.height))
|
||||
impl PartialEq for DirtyScope {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.id == other.id
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for DirtyScope {
|
||||
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
|
||||
self.height.cmp(&other.height)
|
||||
impl Hash for DirtyScope {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
self.id.hash(state);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user