From 5980c5aeee052d7a5ac048ec6a10e41c784eb0c5 Mon Sep 17 00:00:00 2001 From: yanghong Date: Wed, 11 Oct 2023 21:50:38 +0800 Subject: [PATCH] pass clippy check --- src/protocol.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/protocol.rs b/src/protocol.rs index 47050553..057aaa2b 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -116,8 +116,7 @@ impl UdpTraffic { } pub async fn read(reader: &mut T, hdr_len: u8) -> Result { - let mut buf = Vec::new(); - buf.resize(hdr_len as usize, 0); + let mut buf = vec![0; hdr_len as usize]; reader .read_exact(&mut buf) .await