pub fn unified_diff(path: &str, before: &str, after: &str) -> StringExpand description
Produce a minimal unified-diff string using similar::TextDiff.
Always emits a --- a/{path} / +++ b/{path} header even when one side is
empty so downstream renderers can anchor the change to the file it touched.
Any leading / on path is stripped before splicing into the header —
git-style a/ and b/ prefixes already denote the repo root, so an
absolute path like /abs/file.rs would otherwise emit --- a//abs/file.rs,
which breaks patch(1) and other consumers that parse the header.