difft::display::style

Function style_lines

Source
fn style_lines(
    lines: &[&str],
    styles: &[(SingleLineSpan, Style)],
) -> Vec<String>
Expand description

Apply the Styles to the spans specified. Return a vec of the styled strings, including trailing newlines.

Tolerant against lines in s being shorter than the spans.