From 7cdbf048e19b8ceee26a56dcf3b104f3d823c1d0 Mon Sep 17 00:00:00 2001 From: librelois <elois@ifee.fr> Date: Sun, 22 Dec 2019 23:48:25 +0100 Subject: [PATCH] [style] comply to clippy v0.0.212 --- lib/dubp/wot/operations/path.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/dubp/wot/operations/path.rs b/lib/dubp/wot/operations/path.rs index 99a3a8e3..4304e182 100644 --- a/lib/dubp/wot/operations/path.rs +++ b/lib/dubp/wot/operations/path.rs @@ -53,14 +53,18 @@ impl<T: WebOfTrust> PathFinder<T> for RustyPathFinder { for node in border { for source in &wot.get_links_source(node).unwrap() { - if graph[source.0].0 > distance { - // shorter path, we replace - graph[source.0] = (distance, vec![node]); - next_border.insert(*source); - } else if graph[source.0].0 == distance { - // same length, we combine - graph[source.0].1.push(node); - next_border.insert(*source); + match graph[source.0].0 { + path_distance if path_distance > distance => { + // shorter path, we replace + graph[source.0] = (distance, vec![node]); + next_border.insert(*source); + } + path_distance if path_distance == distance => { + // same length, we combine + graph[source.0].1.push(node); + next_border.insert(*source); + } + _ => unreachable!(), } } } -- GitLab