From 00c3ef94fe1b6410e52c70f679c57056d4809067 Mon Sep 17 00:00:00 2001 From: Fina Wilke Date: Fri, 5 Jul 2024 18:53:45 +0200 Subject: [PATCH] transit/v2: alloc buffer on heap --- src/transfer/v2.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transfer/v2.rs b/src/transfer/v2.rs index f4fc4f88..7ea6502d 100644 --- a/src/transfer/v2.rs +++ b/src/transfer/v2.rs @@ -233,7 +233,7 @@ async fn send_inner( // use zstd::stream::raw::Encoder; // let zstd = Encoder::new(zstd::DEFAULT_COMPRESSION_LEVEL); const BUFFER_LEN: usize = 16 * 1024; - let mut buffer = Box::new([0u8; BUFFER_LEN]); + let mut buffer = vec![0u8; BUFFER_LEN].into_boxed_slice(); for AnswerMessageInner { file,