Function difft::display::context::add_ends

source ·
fn add_ends(
    matched_lines: &[(Option<LineNumber>, Option<LineNumber>)],
    lhs_lines: &[&str],
    rhs_lines: &[&str]
) -> Vec<(Option<LineNumber>, Option<LineNumber>)>
Expand description

Extend matched_lines to include the leading and trailing lines in the file.

This is useful when the file contains blank lines at the beginning or end. Those lines won’t have MatchedPos values associated with them, but we still want to match them up.