|
|
@ -305,12 +305,14 @@ impl BankState { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::cmp::PartialEq for BankItem {
|
|
|
|
fn eq(&self, other: &BankItem) -> bool {
|
|
|
|
|
|
|
|
|
|
|
|
impl std::cmp::PartialEq for BankItemDetail {
|
|
|
|
fn eq(&self, other: &BankItemDetail) -> bool {
|
|
|
|
let mut self_bytes = [0u8; 4];
|
|
|
|
let mut other_bytes = [0u8; 4];
|
|
|
|
self_bytes.copy_from_slice(&self.item.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.item.as_client_bytes()[0..4]);
|
|
|
|
self_bytes.copy_from_slice(&self.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.as_client_bytes()[0..4]);
|
|
|
|
|
|
|
|
let self_value = u32::from_be_bytes(self_bytes);
|
|
|
|
let other_value = u32::from_be_bytes(other_bytes);
|
|
|
@ -319,15 +321,14 @@ impl std::cmp::PartialEq for BankItem { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::cmp::Eq for BankItem {}
|
|
|
|
impl std::cmp::Eq for BankItemDetail {}
|
|
|
|
|
|
|
|
impl std::cmp::PartialOrd for BankItem {
|
|
|
|
fn partial_cmp(&self, other: &BankItem) -> Option<std::cmp::Ordering> {
|
|
|
|
impl std::cmp::PartialOrd for BankItemDetail {
|
|
|
|
fn partial_cmp(&self, other: &BankItemDetail) -> Option<std::cmp::Ordering> {
|
|
|
|
let mut self_bytes = [0u8; 4];
|
|
|
|
let mut other_bytes = [0u8; 4];
|
|
|
|
self_bytes.copy_from_slice(&self.item.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.item.as_client_bytes()[0..4]);
|
|
|
|
|
|
|
|
self_bytes.copy_from_slice(&self.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.as_client_bytes()[0..4]);
|
|
|
|
|
|
|
|
let self_value = u32::from_be_bytes(self_bytes);
|
|
|
|
let other_value = u32::from_be_bytes(other_bytes);
|
|
|
@ -336,13 +337,12 @@ impl std::cmp::PartialOrd for BankItem { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::cmp::Ord for BankItem {
|
|
|
|
fn cmp(&self, other: &BankItem) -> std::cmp::Ordering {
|
|
|
|
impl std::cmp::Ord for BankItemDetail {
|
|
|
|
fn cmp(&self, other: &BankItemDetail) -> std::cmp::Ordering {
|
|
|
|
let mut self_bytes = [0u8; 4];
|
|
|
|
let mut other_bytes = [0u8; 4];
|
|
|
|
self_bytes.copy_from_slice(&self.item.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.item.as_client_bytes()[0..4]);
|
|
|
|
|
|
|
|
self_bytes.copy_from_slice(&self.as_client_bytes()[0..4]);
|
|
|
|
other_bytes.copy_from_slice(&other.as_client_bytes()[0..4]);
|
|
|
|
|
|
|
|
let self_value = u32::from_le_bytes(self_bytes);
|
|
|
|
let other_value = u32::from_le_bytes(other_bytes);
|
|
|
@ -351,3 +351,24 @@ impl std::cmp::Ord for BankItem { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl std::cmp::PartialEq for BankItem {
|
|
|
|
fn eq(&self, other: &BankItem) -> bool {
|
|
|
|
self.item.eq(&other.item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::cmp::Eq for BankItem {}
|
|
|
|
|
|
|
|
impl std::cmp::PartialOrd for BankItem {
|
|
|
|
fn partial_cmp(&self, other: &BankItem) -> Option<std::cmp::Ordering> {
|
|
|
|
self.item.partial_cmp(&other.item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::cmp::Ord for BankItem {
|
|
|
|
fn cmp(&self, other: &BankItem) -> std::cmp::Ordering {
|
|
|
|
self.item.cmp(&other.item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|