Skip to main content

get_hunks

Function get_hunks 

Source
pub fn get_hunks(raw_diff_output: &str) -> Result<Vec<(&str, usize)>>
Expand description

Extracts file paths and starting line numbers of hunks from raw git diff output.

Accepts a &str (the full diff output) and splits into lines internally, avoiding per-line String allocations.

ยงErrors

  • Parsing diff output fails.