Skip to main content

parent_creates_cycle

Function parent_creates_cycle 

Source
pub fn parent_creates_cycle(
    items: &[BacklogItem],
    child: &ItemId,
    parent: &ItemId,
) -> bool
Expand description

Return whether assigning parent as child’s parent would create a cycle in items.

Parent-child links must remain acyclic. Trace the ancestors of parent; reaching child means the new link would close a cycle. Track visited IDs so malformed existing data cannot cause an infinite loop.