use std::cmp::Ordering; #[derive(Clone, Copy, Debug)] pub struct Point { pub x: f64, pub y: f64, } impl PartialEq for Point { fn eq(&self, other: &Self) -> bool { self.x == other.x && self.y == other.y } } impl Eq for Point {} impl PartialOrd for Point { fn partial_cmp(&self, other: &Self) -> Option { match self.x.partial_cmp(&other.x) { Some(core::cmp::Ordering::Equal) => {} ord => return ord, } self.y.partial_cmp(&other.y) } } impl Ord for Point { fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.partial_cmp(other).unwrap_or(Ordering::Equal) } } #[derive(Default, Copy, Clone, Debug)] pub struct Value { _data_0: [u8; 24], _data_1: [u8; 24], }