Skip to main content

parse_patch

Function parse_patch 

Source
pub fn parse_patch(text: &str) -> Result<Vec<Change>, PatchError>
Expand description

Parse a unified diff into the set of files it touches.

Strict: anything it does not recognise is an error rather than a skipped line. See the module documentation for why the trade goes the opposite way from the diff slicer’s.

§Errors

PatchError if the patch contains a construct this parser cannot account for, a malformed hunk header, or an unfinished hunk.