Skip to main content

write_revisions_json

Function write_revisions_json 

pub fn write_revisions_json<W: Write>(
    rows: &[(String, u32)],
    w: &mut W,
) -> Result<()>
Expand description

revisions emitter โ€” the tuple (path, n_revs) is serialised as a named-field struct so JSON consumers see {"entity": "...", "n_revs": N} rather than ["...", N] (which would be the default tuple serialisation).

ยงErrors

Returns crate::CodeLoreError::Io when the output sink fails mid-write (e.g. a reader closed the pipe early) and crate::CodeLoreError::Output on a genuine serialisation fault.