Skip to content

Commit 1607a40

Browse files
committed
Fix check for pre-existing edge in must_check_for_cycle
1 parent c3312fc commit 1607a40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ fn must_check_for_cycle<N, E, Ix>(dag: &Dag<N, E, Ix>,
492492
where Ix: IndexType,
493493
{
494494
dag.parents(a).next(dag).is_some() && dag.children(b).next(dag).is_some()
495-
&& !dag.children(a).any(dag, |_, e, _| e != new_edge)
495+
&& !dag.children(a).any(dag, |_, e, n| n == b && e != new_edge)
496496
}
497497

498498

0 commit comments

Comments
 (0)