Skip to main content

apply_patch

Function apply_patch 

Source
pub fn apply_patch(original: &str, patch: &FilePatch) -> PunchResult<String>
Expand description

Apply a single file patch to the original content — execute the combo.

Each hunk is applied in order. Context lines are verified against the original to ensure the move connects. Returns the modified content as a string.