diff options
author | 2023-11-03 19:37:43 +0800 | |
---|---|---|
committer | 2023-11-03 11:37:43 +0000 | |
commit | 84c04ab9df3a68dfcf7932bf3550c3e436d10204 (patch) | |
tree | 85a11c83f93c1b80d069d4d764fc6cf106ab3775 | |
parent | ebb764ae53d7ffe4fcb45f83f7563bec5c74199d (diff) | |
download | rathole-84c04ab9df3a68dfcf7932bf3550c3e436d10204.tar.gz rathole-84c04ab9df3a68dfcf7932bf3550c3e436d10204.tar.zst rathole-84c04ab9df3a68dfcf7932bf3550c3e436d10204.zip |
fix: clippy (#302)
-rw-r--r-- | src/protocol.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/protocol.rs b/src/protocol.rs index 577c732..955346e 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -112,8 +112,7 @@ impl UdpTraffic { } pub async fn read<T: AsyncRead + Unpin>(reader: &mut T, hdr_len: u8) -> Result<UdpTraffic> { - 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 |