Skip to content

Commit

Permalink
Applied clippy sugestion
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSchmid committed Feb 11, 2024
1 parent 2b6cc54 commit b489fd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions etherparse/src/lax_sliced_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,13 @@ impl<'a> LaxSlicedPacket<'a> {
VlanSlice::SingleVlan(s) => Some(s.payload()),
VlanSlice::DoubleVlan(s) => Some(s.payload()),
}
} else {
if let Some(eth) = self.link.as_ref() {
match eth {
LinkSlice::Ethernet2(e) => Some(e.payload()),
LinkSlice::EtherPayload(e) => Some(e.clone()),
}
} else {
None
} else if let Some(eth) = self.link.as_ref() {
match eth {
LinkSlice::Ethernet2(e) => Some(e.payload()),
LinkSlice::EtherPayload(e) => Some(e.clone()),
}
} else {
None
}
}

Expand Down
14 changes: 6 additions & 8 deletions etherparse/src/sliced_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,13 @@ impl<'a> SlicedPacket<'a> {
VlanSlice::SingleVlan(s) => Some(s.payload()),
VlanSlice::DoubleVlan(s) => Some(s.payload()),
}
} else {
if let Some(eth) = self.link.as_ref() {
match eth {
LinkSlice::Ethernet2(e) => Some(e.payload()),
LinkSlice::EtherPayload(e) => Some(e.clone()),
}
} else {
None
} else if let Some(eth) = self.link.as_ref() {
match eth {
LinkSlice::Ethernet2(e) => Some(e.payload()),
LinkSlice::EtherPayload(e) => Some(e.clone()),
}
} else {
None
}
}

Expand Down

0 comments on commit b489fd9

Please sign in to comment.