summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2022-02-20 15:54:01 -0800
committerWilfred Hughes <me@wilfred.me.uk>2022-02-20 15:54:01 -0800
commitc8378dd5892128f84b2b1d212500c9d6c16f4798 (patch)
tree76d14b71b66dcb7020692430f0b48a8ebf13ceb4
parent157fbf23a9450b18f4f2d5030227f03a37561ede (diff)
Clarify how many items in the path we're logging0.20.0
-rw-r--r--src/dijkstra.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/dijkstra.rs b/src/dijkstra.rs
index 9c21cdf77..a8c67ce91 100644
--- a/src/dijkstra.rs
+++ b/src/dijkstra.rs
@@ -75,17 +75,15 @@ fn shortest_path(start: Vertex) -> Vec<(Edge, Vertex)> {
route.reverse();
info!("Found a path of {} with cost {}.", route.len(), cost);
+ let print_length = if env::var("DFT_VERBOSE").is_ok() {
+ 50
+ } else {
+ 5
+ };
info!(
- "Initial path: {:#?}",
- route
- .iter()
- .map(|x| x.0)
- .take(if env::var("DFT_VERBOSE").is_ok() {
- 50
- } else {
- 5
- })
- .collect_vec()
+ "Initial {} items on path: {:#?}",
+ print_length,
+ route.iter().map(|x| x.0).take(print_length).collect_vec()
);
route
}