Detect if no path exists

This commit is contained in:
Joscha 2022-10-22 18:41:40 +02:00
parent 179e6b74a5
commit 0d4087fdde

View file

@ -127,12 +127,11 @@ fn dijkstra(
}; };
} }
steps.reverse(); steps.reverse();
Some(steps) if steps.first() == Some(&from_idx) {
// if steps.first() == Some(&from_idx) { Some(steps)
// Some(steps) } else {
// } else { None
// None }
// }
} }
pub fn path(datafile: &Path, from: &str, to: &str) -> io::Result<()> { pub fn path(datafile: &Path, from: &str, to: &str) -> io::Result<()> {