Remove unnecessary clones
These were flagged by `cargo clippy`: warning: using `clone` on a `Copy` type
This commit is contained in:
parent
33236f23f4
commit
039a55e1bf
|
@ -295,11 +295,11 @@ impl<'a> IpPacket<'a> {
|
|||
pub(crate) fn ip_repr(&self) -> IpRepr {
|
||||
match self {
|
||||
#[cfg(feature = "proto-ipv4")]
|
||||
IpPacket::Icmpv4((ipv4_repr, _)) => IpRepr::Ipv4(ipv4_repr.clone()),
|
||||
IpPacket::Icmpv4((ipv4_repr, _)) => IpRepr::Ipv4(*ipv4_repr),
|
||||
#[cfg(feature = "proto-igmp")]
|
||||
IpPacket::Igmp((ipv4_repr, _)) => IpRepr::Ipv4(ipv4_repr.clone()),
|
||||
IpPacket::Igmp((ipv4_repr, _)) => IpRepr::Ipv4(*ipv4_repr),
|
||||
#[cfg(feature = "proto-ipv6")]
|
||||
IpPacket::Icmpv6((ipv6_repr, _)) => IpRepr::Ipv6(ipv6_repr.clone()),
|
||||
IpPacket::Icmpv6((ipv6_repr, _)) => IpRepr::Ipv6(*ipv6_repr),
|
||||
#[cfg(feature = "socket-raw")]
|
||||
IpPacket::Raw((ip_repr, _)) => ip_repr.clone(),
|
||||
#[cfg(feature = "socket-udp")]
|
||||
|
|
Loading…
Reference in New Issue