Skip to main content

unified_diff_with_prefix_and_funcname_and_algorithm

Function unified_diff_with_prefix_and_funcname_and_algorithm 

Source
pub fn unified_diff_with_prefix_and_funcname_and_algorithm(
    old_content: &str,
    new_content: &str,
    old_path: &str,
    new_path: &str,
    context_lines: usize,
    inter_hunk_context: usize,
    src_prefix: &str,
    dst_prefix: &str,
    funcname_matcher: Option<&FuncnameMatcher>,
    algorithm: Algorithm,
    function_context: bool,
    use_git_histogram: bool,
    indent_heuristic: bool,
    quote_path_fully: bool,
) -> String
Expand description

Same as unified_diff_with_prefix_and_funcname but allows callers to choose the line diff algorithm used for hunk generation.

When function_context is true (git diff -W), hunks are expanded to whole logical functions using the same rules as Git’s XDL_EMIT_FUNCCONTEXT.