Fix multiple issues pointed out by the new compiler

This commit is contained in:
Zhang Junyang
2024-10-13 21:39:47 +08:00
committed by Tate, Hongliang Tian
parent 5f2bd9d0ac
commit 9e4257b655
62 changed files with 211 additions and 178 deletions

View File

@ -162,9 +162,9 @@ impl<D, E> EtherIface<D, E> {
}
// Ignore the ARP packet if we do not own the target address.
if !iface_cx
if iface_cx
.ipv4_addr()
.is_some_and(|addr| addr == *target_protocol_addr)
.is_none_or(|addr| addr != *target_protocol_addr)
{
return None;
}

View File

@ -44,7 +44,7 @@ impl<'a, E> PollContext<'a, E> {
pub(super) trait FnHelper<A, B, C, O>: FnMut(A, B, C) -> O {}
impl<A, B, C, O, F> FnHelper<A, B, C, O> for F where F: FnMut(A, B, C) -> O {}
impl<'a, E> PollContext<'a, E> {
impl<E> PollContext<'_, E> {
pub(super) fn poll_ingress<D, P, Q>(
&mut self,
device: &mut D,
@ -280,7 +280,7 @@ impl<'a, E> PollContext<'a, E> {
}
}
impl<'a, E> PollContext<'a, E> {
impl<E> PollContext<'_, E> {
pub(super) fn poll_egress<D, Q>(&mut self, device: &mut D, mut dispatch_phy: Q)
where
D: Device + ?Sized,