From a4d54faba85bf8e628c34561ffd8d19cea296d18 Mon Sep 17 00:00:00 2001 From: Lee Smet Date: Mon, 23 Oct 2023 15:59:18 +0200 Subject: [PATCH] Fix RouteKey PartialOrd implementation Signed-off-by: Lee Smet --- src/routing_table.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/routing_table.rs b/src/routing_table.rs index 59d61d3..58d385c 100644 --- a/src/routing_table.rs +++ b/src/routing_table.rs @@ -22,13 +22,7 @@ pub struct RouteKey { impl Eq for RouteKey {} impl PartialOrd for RouteKey { fn partial_cmp(&self, other: &Self) -> Option { - match self.subnet.partial_cmp(&other.subnet) { - Some(Ordering::Equal) => self - .neighbor - .overlay_ip() - .partial_cmp(&other.neighbor.overlay_ip()), - ord => ord, - } + Some(self.cmp(other)) } } impl Ord for RouteKey {