rows_to_toc_entries

Function rows_to_toc_entries 

Source
pub fn rows_to_toc_entries(
    rows: &[TocEntryRow],
) -> Result<Vec<SimpleTocEntry>, Error>
Expand description

Reconstruct a Vec<SimpleTocEntry> tree from a flat list of rows ordered by id.

Rows must be ordered such that every parent appears before its children (pre-order), which is guaranteed by inserting parents first and ordering by id ASC.