From b5f820b22573e3df92433d6f4094088ed6595217 Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Fri, 6 Sep 2024 12:33:21 +0200 Subject: [PATCH] Update zenoh/src/net/routing/hat/p2p_peer/queries.rs Co-authored-by: Joseph Perez --- zenoh/src/net/routing/hat/p2p_peer/queries.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zenoh/src/net/routing/hat/p2p_peer/queries.rs b/zenoh/src/net/routing/hat/p2p_peer/queries.rs index ee498e1677..debbc717b3 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/queries.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/queries.rs @@ -645,7 +645,7 @@ impl HatQueriesTrait for HatCode { } } } - route.sort_by_key(|qabl| qabl.info.map(|i| i.distance).unwrap_or(u16::MAX)); + route.sort_by_key(|qabl| qabl.info.map_or(u16::MAX, |i| i.distance)); Arc::new(route) }