chore: reformat & clippy cleanup (#96)

Clippy is now added to the `check` in the pipeline

Co-authored-by: Ian Letourneau <letourneau.ian@gmail.com>
Reviewed-on: NationTech/harmony#96
This commit is contained in:
2025-08-06 15:57:14 +00:00
parent 024084859e
commit 440c1bce12
68 changed files with 342 additions and 350 deletions

View File

@@ -64,7 +64,7 @@ impl<'a> DhcpConfig<'a> {
.dhcpd
.elements
.iter_mut()
.find(|(name, _config)| return name == "lan")
.find(|(name, _config)| name == "lan")
.expect("Interface lan should have dhcpd activated")
.1
}
@@ -93,11 +93,7 @@ impl<'a> DhcpConfig<'a> {
== ipaddr
&& m.mac == mac
}) {
info!(
"Mapping already exists for {} [{}], skipping",
ipaddr.to_string(),
mac
);
info!("Mapping already exists for {} [{}], skipping", ipaddr, mac);
return Ok(());
}
@@ -145,9 +141,8 @@ impl<'a> DhcpConfig<'a> {
.exec("configctl dhcpd list static")
.await?;
let value: serde_json::Value = serde_json::from_str(&list_static_output).expect(&format!(
"Got invalid json from configctl {list_static_output}"
));
let value: serde_json::Value = serde_json::from_str(&list_static_output)
.unwrap_or_else(|_| panic!("Got invalid json from configctl {list_static_output}"));
let static_maps = value["dhcpd"]
.as_array()
.ok_or(Error::Command(format!(