Skip to content

Commit 2532bd1

Browse files
committed
Apply rustfmt
1 parent c84aa5d commit 2532bd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/rust/Dijkstra.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ impl Graph {
2727

2828
// Add an edge to the graph from 'from' node to 'to' node with a given weight.
2929
fn add_edge(&mut self, from: usize, to: usize, weight: i32) {
30-
self.edges[from].push(Edge {
31-
target: to,
32-
weight,
33-
});
30+
self.edges[from].push(Edge { target: to, weight });
3431
}
3532

3633
// Find the shortest path from a specified starting node using Dijkstra's algorithm.
@@ -83,6 +80,9 @@ fn main() {
8380

8481
// Print the results.
8582
for (node, distance) in shortest_distances.iter() {
86-
println!("Shortest distance from node {} to node {}: {}", start_node, node, distance);
83+
println!(
84+
"Shortest distance from node {} to node {}: {}",
85+
start_node, node, distance
86+
);
8787
}
8888
}

0 commit comments

Comments
 (0)