fix: clippy (#302)

This commit is contained in:
Yujia Qiao 2023-11-03 19:37:43 +08:00 committed by GitHub
parent ebb764ae53
commit 84c04ab9df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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