Skip to content

Commit

Permalink
fix: clippy (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
rapiz1 authored Nov 3, 2023
1 parent ebb764a commit 84c04ab
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit 84c04ab

@zsinba
Copy link

@zsinba zsinba commented on 84c04ab Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问这个修改带来的影响是什么? 看起来是一样的呀

Please sign in to comment.