Detect if no path exists
This commit is contained in:
parent
179e6b74a5
commit
0d4087fdde
1 changed files with 5 additions and 6 deletions
|
|
@ -127,12 +127,11 @@ fn dijkstra(
|
|||
};
|
||||
}
|
||||
steps.reverse();
|
||||
Some(steps)
|
||||
// if steps.first() == Some(&from_idx) {
|
||||
// Some(steps)
|
||||
// } else {
|
||||
// None
|
||||
// }
|
||||
if steps.first() == Some(&from_idx) {
|
||||
Some(steps)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn path(datafile: &Path, from: &str, to: &str) -> io::Result<()> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue