@@ -119,7 +119,7 @@ impl<T: Display + Eq + Hash> Graph<T> {
119119
120120/// Structure to store the shortest path and distance from one node
121121/// to other nodes after a pathfinding algorithm has been run on a graph.
122- #[ derive( Debug , Eq , PartialEq ) ]
122+ #[ derive( Eq , PartialEq , Debug ) ]
123123pub struct ShortestPathTree < T : Display + Clone + Hash + Eq > {
124124 source : T ,
125125 results : HashMap < T , Option < ( i32 , ShortestPath < T > ) > > ,
@@ -212,7 +212,7 @@ impl<T: Display + Clone + Eq + Hash> ShortestPathTree<T> {
212212}
213213
214214/// The shortest path from one node to another.
215- #[ derive( Debug , Eq , PartialEq , Clone ) ]
215+ #[ derive( Clone , Eq , PartialEq , Ord , PartialOrd , Hash , Debug ) ]
216216pub struct ShortestPath < T : Display + Clone > { // Add documentation
217217 /// Contains a list of node ids, first entry is the start node, last entry is the target node.
218218 path : Vec < T > , //TODO maybe add later that the distance between each node is stored as well
@@ -374,7 +374,7 @@ impl<T: Display + Clone + Eq> TryFrom<&Rc<RefCell<Node<T>>>> for ShortestPath<T>
374374 }
375375}
376376
377- #[ derive( Debug , PartialEq , Eq ) ]
377+ #[ derive( Clone , Eq , PartialEq , PartialOrd , Ord , Hash , Debug ) ]
378378/// Errors that can occur when edges are added to the graph.
379379///
380380/// Variants specify what exact node is missing.
0 commit comments