Fix new clippy warnings

This commit is contained in:
Aram 🍐 2023-12-21 15:16:57 -05:00
parent 7200cc07e7
commit 731218d943
3 changed files with 3 additions and 4 deletions

View file

@ -119,8 +119,7 @@ impl smoltcp::phy::TxToken for TxToken {
where
F: FnOnce(&mut [u8]) -> smoltcp::Result<R>,
{
let mut buffer = Vec::new();
buffer.resize(len, 0);
let mut buffer = vec![0; len];
let result = f(&mut buffer);
self.sender
.send(Event::OutboundInternetPacket(buffer.into()));

View file

@ -229,7 +229,7 @@ impl VirtualInterfacePoll for TcpVirtualInterface {
next_poll = None;
}
}
Event::VirtualDeviceFed(protocol) if protocol == PortProtocol::Tcp => {
Event::VirtualDeviceFed(PortProtocol::Tcp) => {
next_poll = None;
}
_ => {}

View file

@ -198,7 +198,7 @@ impl VirtualInterfacePoll for UdpVirtualInterface {
}
next_poll = None;
}
Event::VirtualDeviceFed(protocol) if protocol == PortProtocol::Udp => {
Event::VirtualDeviceFed(PortProtocol::Udp) => {
next_poll = None;
}
_ => {}