Skip to main content

bounded_display_lines

Function bounded_display_lines 

Source
pub fn bounded_display_lines(
    lines: &[DiffDisplayLine],
    max_rows: usize,
) -> Vec<DiffDisplayLine>
Expand description

Returns a bounded head/tail excerpt of semantic display lines.

ยงContract

  • Ensures: result length is <= max_rows; max_rows == 0 yields empty.
  • Ensures: when omitting, exactly one Metadata marker (... N lines omitted ...) separates retained head and tail, and retained entries keep their source numbers and intraline ranges.
  • Termination: no loops over unbounded state (two bounded copies).