Skip to main content

would_create_cycle

Function would_create_cycle 

Source
pub fn would_create_cycle(
    parent_of: impl Fn(NodeId) -> Option<NodeId>,
    dragged: NodeId,
    target: NodeId,
) -> bool
Expand description

Would attaching dragged under target create a cycle? Walks target’s ancestry via the parent_of lookup you provide.