Skip to main content

write_output_segments

Function write_output_segments 

Source
pub fn write_output_segments(
    segments: &[&str],
    dest: Option<&str>,
) -> Result<()>
Expand description

Like write_output but writes several segments back-to-back without concatenating them into one buffer first. Used for the conversion log, where the core and post-phase segments are each already-allocated and large for real articles — a format!("{core}{post}") would allocate a third copy of their combined size on the conversion hot path. Segments are written verbatim and in order through a single BufWriter (one file open/truncate); insert any separators (e.g. "\n") as their own segments.