From 929eb9e84604fc3086ac8dacabfd9d4ef6cbbf97 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Tue, 20 Sep 2022 15:30:53 +0200 Subject: [PATCH] follow idiom (#513) * follow idiom * follow idiom some more --- src/algo/dijkstra.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/algo/dijkstra.rs b/src/algo/dijkstra.rs index cad6539fa..b2876b268 100644 --- a/src/algo/dijkstra.rs +++ b/src/algo/dijkstra.rs @@ -27,7 +27,7 @@ use crate::visit::{EdgeRef, IntoEdges, VisitMap, Visitable}; /// use petgraph::prelude::*; /// use std::collections::HashMap; /// -/// let mut graph : Graph<(),(),Directed>= Graph::new(); +/// let mut graph: Graph<(), (), Directed> = Graph::new(); /// let a = graph.add_node(()); // node with no weight /// let b = graph.add_node(()); /// let c = graph.add_node(()); @@ -48,7 +48,7 @@ use crate::visit::{EdgeRef, IntoEdges, VisitMap, Visitable}; /// (b, e), /// (f, g), /// (g, h), -/// (h, e) +/// (h, e), /// ]); /// // a ----> b ----> e ----> f /// // ^ | ^ | @@ -56,16 +56,16 @@ use crate::visit::{EdgeRef, IntoEdges, VisitMap, Visitable}; /// // d <---- c h <---- g /// /// let expected_res: HashMap = [ -/// (a, 3), -/// (b, 0), -/// (c, 1), -/// (d, 2), -/// (e, 1), -/// (f, 2), -/// (g, 3), -/// (h, 4) -/// ].iter().cloned().collect(); -/// let res = dijkstra(&graph,b,None, |_| 1); +/// (a, 3), +/// (b, 0), +/// (c, 1), +/// (d, 2), +/// (e, 1), +/// (f, 2), +/// (g, 3), +/// (h, 4), +/// ].iter().cloned().collect(); +/// let res = dijkstra(&graph, b, None, |_| 1); /// assert_eq!(res, expected_res); /// // z is not inside res because there is not path from b to z. /// ```