Skip to content

Commit 2d607df

Browse files
committed
Fix a few clippy warnings
1 parent e681086 commit 2d607df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,15 @@ async fn run((ip, interface, mac, ip_managed, args): Prep) -> Result<()> {
414414

415415
loop {
416416
let pkt = rx.next()?;
417-
let eth =
418-
EthernetPacket::new(pkt).ok_or_else(|| eyre!("eth packet buffer too small"))?;
417+
let eth = EthernetPacket::new(pkt)
418+
.ok_or_else(|| eyre!("eth packet buffer too small"))?;
419419
if eth.get_ethertype() != EtherTypes::Arp {
420420
continue;
421421
}
422422

423423
let pay = eth.payload();
424-
let arp = ArpPacket::new(pay).ok_or_else(|| eyre!("arp packet buffer too small"))?;
424+
let arp =
425+
ArpPacket::new(pay).ok_or_else(|| eyre!("arp packet buffer too small"))?;
425426

426427
let op = match arp.get_operation() {
427428
ArpOperations::Reply => String::from("reply"),
@@ -560,7 +561,7 @@ async fn run((ip, interface, mac, ip_managed, args): Prep) -> Result<()> {
560561
}
561562

562563
if ip_managed {
563-
info!("removing ip from interface", { ip: &ip as &dyn std::fmt::Display, interface: interface.index });
564+
info!("removing ip from interface", { ip: as_display!(ip), interface: interface.index });
564565
let mut addrlist = nlah.get().execute();
565566
while let Some(addr) = addrlist.try_next().await? {
566567
if addr.header.index != interface.index {

0 commit comments

Comments
 (0)