Skip to main content

format_hunk_header

Function format_hunk_header 

Source
pub fn format_hunk_header(
    old_start: usize,
    old_count: usize,
    new_start: usize,
    new_count: usize,
) -> String
Expand description

Formats a git-compatible @@ -old +new @@ hunk header.

Range counts are preserved rather than collapsed to start-only form: a pure deletion such as @@ -65,19 +65,0 @@ must not read as a one-line change. Counts of one are elided (@@ -1 +1 @@) to match git diff.