From 26d20b806b87929c01c9f7e6db7d9a1f6f372452 Mon Sep 17 00:00:00 2001 From: a Date: Sat, 17 Oct 2026 11:08:36 +0200 Subject: [PATCH] perf: hand over per-page SVG bytes without copying typst_svg::svg returns an owned String, so its bytes can be moved into the output buffer instead of copied, matching the merged-SVG path. --- src/typst_core/src/compiler.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/typst_core/src/compiler.rs b/src/typst_core/src/compiler.rs index 423c52e..54dbac7 100644 --- a/src/typst_core/src/compiler.rs +++ b/src/typst_core/src/compiler.rs @@ -34,10 +34,7 @@ fn export_image( ) .encode_png() .map_err(|err| eco_format!("failed to write PNG file ({err})"))?, - ImageExportFormat::Svg => { - let svg = typst_svg::svg(page, &svg_options()); - svg.as_bytes().to_vec() - } + ImageExportFormat::Svg => typst_svg::svg(page, &svg_options()).into_bytes(), }; buffers.push(buffer); }