conflictdb/ckeycmp.rs
1use crate::ckey::CKey;
2
3use std::cmp::Ordering;
4
5#[derive(Debug, PartialEq, Eq)]
6struct CKeyCmp {
7 start: CKey,
8 key: CKey,
9 diff: CKey,
10}
11
12impl CKeyCmp {
13 fn new(start: CKey, key: CKey) -> CKeyCmp {
14 CKeyCmp {
15 start,
16 key,
17 diff: key - start,
18 }
19 }
20}
21
22impl std::cmp::PartialOrd for CKeyCmp {
23 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
24 if *self == *other {
25 return Some(Ordering::Equal);
26 }
27 // [TODO] implement this
28 None
29 }
30}