pub fn write_diff<W: Write>(
w: &mut W,
diff: &CtprofDiff,
baseline_path: &Path,
candidate_path: &Path,
group_by: GroupBy,
display: &DisplayOptions,
) -> ResultExpand description
Render CtprofDiff into w. The formatter layer lives
here so tests can inspect exactly what print_diff would
emit without shelling through stdout capture. Write errors
propagate as std::fmt::Error — callers that write into an
infallible sink (String) can unwrap or ignore.
display controls per-row column layout, terminal-width
wrapping, and per-section filtering: see DisplayFormat /
Column / Section / DisplayOptions for the
resolution rules. Each sub-emitter is gated on
DisplayOptions::is_section_enabled before its
data-availability check, so --sections always wins over
the per-section zero-suppression heuristic.