Clarify how many items in the path we're logging

html_output 0.20.0
Wilfred Hughes 2022-02-20 15:54:01 +07:00
parent 157fbf23a9
commit c8378dd589
1 changed files with 8 additions and 10 deletions

@ -75,17 +75,15 @@ fn shortest_path(start: Vertex) -> Vec<(Edge, Vertex)> {
route.reverse(); route.reverse();
info!("Found a path of {} with cost {}.", route.len(), cost); info!("Found a path of {} with cost {}.", route.len(), cost);
info!( let print_length = if env::var("DFT_VERBOSE").is_ok() {
"Initial path: {:#?}",
route
.iter()
.map(|x| x.0)
.take(if env::var("DFT_VERBOSE").is_ok() {
50 50
} else { } else {
5 5
}) };
.collect_vec() info!(
"Initial {} items on path: {:#?}",
print_length,
route.iter().map(|x| x.0).take(print_length).collect_vec()
); );
route route
} }