From f7f37fd7d7cddab36b0a6af009da316b6ef507ea Mon Sep 17 00:00:00 2001 From: kozabrada123 Date: Sun, 23 Jun 2024 17:01:48 +0200 Subject: [PATCH] fix: sorta-of fix decomp error --- src/gateway/message.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gateway/message.rs b/src/gateway/message.rs index bc86c04..652073b 100644 --- a/src/gateway/message.rs +++ b/src/gateway/message.rs @@ -90,7 +90,9 @@ impl GatewayMessage { bytes: &[u8], inflate: &mut flate2::Decompress, ) -> Result { - let mut output = Vec::with_capacity(bytes.len() * 10); + + // Note: is there a better way to handle the size of this output buffer? + let mut output = Vec::with_capacity(bytes.len() * 32); let _status = inflate.decompress_vec(bytes, &mut output, flate2::FlushDecompress::Sync)?; output.shrink_to_fit();