Remove unnecessary clones

These were flagged by `cargo clippy`:

    warning: using `clone` on a `Copy` type
This commit is contained in:
Alex Crawford 2020-12-28 23:05:48 -08:00
parent 33236f23f4
commit 039a55e1bf
1 changed files with 3 additions and 3 deletions

View File

@ -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")]