Skip to main content

next_rid

Function next_rid 

Source
pub fn next_rid(existing_rels: &[Relationship]) -> String
Expand description

Generate the lowest unused rId{n} (n >= 1) for a relationship collection.

Every existing relationship ID of the form rIdN is treated as used, so gaps left by removed relationships are reused. With len relationships at least one of 1..=len + 1 is free, so the search never overflows.