Skip to main content

build_version

Function build_version 

Source
pub fn build_version(
    generation: u64,
    records: Vec<CandidateRecord>,
) -> CandidateVersion
Expand description

What: Build a version from listing records, keeping the first record of each pathname. Vec<CandidateRecord> is taken by value: the records’ bytes move into the version without being copied. Why: A merge commit lists one comparison per parent, so a pathname can appear more than once; the first appearance decides, as it did in the TypeScript wrapper.

In TS you’d write (pseudocode):

function buildVersion(generation: bigint, records: CandidateRecord[]): CandidateVersion;