Skip to main content

split_unified_files

Function split_unified_files 

Source
pub fn split_unified_files(
    input: &str,
) -> Result<Vec<UnifiedFile>, ParseDiffError>
Expand description

Splits multi-file unified text into per-file hunk groups.

§Requires

  • input is UTF-8 unified-diff text.

§Ensures

  • Ok(files) holds one entry per file section, each with at least one hunk validated by DiffDocument::from_unified.
  • Returns Err for lossy input a renderer would tolerate: \ No newline markers, omitted-row markers, sections without hunks, and unparseable quoted paths. Total (terminating): single pass plus one bounded parse per section.