Closed mtreinish closed 1 month ago
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
src/shortest_path/all_pairs_bellman_ford.rs | 6 | 95.53% | ||
<!-- | Total: | 6 | --> |
Totals | |
---|---|
Change from base Build 9104623275: | -0.04% |
Covered Lines: | 16744 |
Relevant Lines: | 17356 |
In the recently merged #1192 a new generic DAG longest_path function was added to rustworkx-core. However, the trait bounds on the function were a bit tighter than they needed to be. The traits were forcing NodeId to be of a NodeIndex type and this wasn't really required. The only requirement that the NodeId type can be put on a hashmap and do a partial compare (that implements Hash, Eq, and PartialOrd). Also the IntoNeighborsDirected wasn't required because it's methods weren't ever used. This commit loosens the traits bounds to facilitate this. At the same time this also simplifies the code structure a bit to reduce the separation of the rust code structure in the rustworkx crate using longest_path().