Skip to content

Commit 2d8f6c1

Browse files
committed
Cleans up some clippy lints
1 parent f5fa089 commit 2d8f6c1

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/iface/interface.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,22 +1015,14 @@ impl<'a> Interface<'a> {
10151015
self.inner.now = timestamp;
10161016

10171017
#[cfg(feature = "proto-ipv4-fragmentation")]
1018-
if let Err(e) = self
1019-
.fragments
1018+
self.fragments
10201019
.ipv4_fragments
1021-
.remove_when(|frag| Ok(timestamp >= frag.expires_at()?))
1022-
{
1023-
return Err(e);
1024-
}
1020+
.remove_when(|frag| Ok(timestamp >= frag.expires_at()?))?;
10251021

10261022
#[cfg(feature = "proto-sixlowpan-fragmentation")]
1027-
if let Err(e) = self
1028-
.fragments
1023+
self.fragments
10291024
.sixlowpan_fragments
1030-
.remove_when(|frag| Ok(timestamp >= frag.expires_at()?))
1031-
{
1032-
return Err(e);
1033-
}
1025+
.remove_when(|frag| Ok(timestamp >= frag.expires_at()?))?;
10341026

10351027
#[cfg(feature = "proto-ipv4-fragmentation")]
10361028
match self.ipv4_egress(device) {

src/wire/dhcpv4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl<T: AsRef<[u8]>> Packet<T> {
364364
let mut buf = &self.buffer.as_ref()[field::OPTIONS];
365365
iter::from_fn(move || {
366366
loop {
367-
match buf.get(0).copied() {
367+
match buf.first().copied() {
368368
// No more options, return.
369369
None => return None,
370370
Some(field::OPT_END) => return None,

0 commit comments

Comments
 (0)