diff --git a/crates/format/src/lib.rs b/crates/format/src/lib.rs index bcfacd976..a05a8baa7 100644 --- a/crates/format/src/lib.rs +++ b/crates/format/src/lib.rs @@ -36,6 +36,16 @@ pub fn save_with_preview(doc: &Document, preview: Option<&[u8]>) -> Result(out: &mut W, doc: &Document, preview: Option<&[u8]>) -> Result<(), FormatError> { + let bytes = save_with_preview(doc, preview)?; + for chunk in bytes.chunks(1 << 20) { + out.write_all(chunk).map_err(|e| FormatError::Io(e.to_string()))?; + } + Ok(()) +} + /// Required native format version for a document. Kept for app-side compatibility; inference is /// performed by the shared codec over the serialized neutral document schema. #[cfg(test)]