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);
let print_length = if env::var("DFT_VERBOSE").is_ok() {
50
} else {
5
};
info!( info!(
"Initial path: {:#?}", "Initial {} items on path: {:#?}",
route print_length,
.iter() route.iter().map(|x| x.0).take(print_length).collect_vec()
.map(|x| x.0)
.take(if env::var("DFT_VERBOSE").is_ok() {
50
} else {
5
})
.collect_vec()
); );
route route
} }