From 1e75a9435e23dd79c889cef09eef3e4423696be3 Mon Sep 17 00:00:00 2001 From: elpekenin Date: Tue, 29 Aug 2023 14:02:50 +0200 Subject: [PATCH] Initial --- xap-specs/src/protocol/broadcast.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/xap-specs/src/protocol/broadcast.rs b/xap-specs/src/protocol/broadcast.rs index 80b57bf..ac5b42d 100644 --- a/xap-specs/src/protocol/broadcast.rs +++ b/xap-specs/src/protocol/broadcast.rs @@ -64,11 +64,7 @@ impl BinRead for LogBroadcast { _endian: Endian, _args: Self::Args<'_>, ) -> binrw::BinResult { - let len: u8 = reader.read_le()?; - let mut bytes = Vec::with_capacity(len as usize); - reader.read_exact(&mut bytes[..len as usize])?; - let mut cursor = Cursor::new(&bytes); - Ok(Self(std::io::read_to_string(&mut cursor)?)) + Ok(Self(std::io::read_to_string(reader)?)) } }