It doesn't mutate self, so it could just take an immutable &self ref.
Also, it seems like get_path_to shouldn't need to consume self -- &mut self would be fine, and allow reusing the SSSP calculation without cloning the entire Dijkstra structure. But maybe I'm missing something.
It doesn't mutate
self, so it could just take an immutable&selfref.Also, it seems like
get_path_toshouldn't need to consumeself--&mut selfwould be fine, and allow reusing the SSSP calculation without cloning the entireDijkstrastructure. But maybe I'm missing something.