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();
|
steps.reverse();
|
||||||
|
if steps.first() == Some(&from_idx) {
|
||||||
Some(steps)
|
Some(steps)
|
||||||
// if steps.first() == Some(&from_idx) {
|
} else {
|
||||||
// Some(steps)
|
None
|
||||||
// } else {
|
}
|
||||||
// None
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn path(datafile: &Path, from: &str, to: &str) -> io::Result<()> {
|
pub fn path(datafile: &Path, from: &str, to: &str) -> io::Result<()> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue