~jpastuszek/asn-db

ef5b5341f4ef59ba123e5858014263d1190e705a — Jakub Pastuszek 8 months ago 0b6a0df
derive Eq and Ord
1 files changed, 1 insertions(+), 9 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +1 -9
@@ 62,7 62,7 @@ const DATABASE_DATA_TAG: &[u8; 4] = b"ASDB";
const DATABASE_DATA_VERSION: &[u8; 4] = b"bin1";

/// Autonomous System number record.
#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone, Eq, Ord)]
pub struct Record {
    /// Network base IP address (host byte order).
    pub ip: u32,


@@ 82,14 82,6 @@ impl PartialEq for Record {
    }
}

impl Eq for Record {}

impl Ord for Record {
    fn cmp(&self, other: &Record) -> Ordering {
        self.ip.cmp(&other.ip)
    }
}

impl PartialOrd for Record {
    fn partial_cmp(&self, other: &Record) -> Option<Ordering> {
        Some(self.cmp(other))