fix: clippy errors with stable toolchain and default features (#1553)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tunglies
2025-11-07 20:08:39 +08:00
committed by GitHub
parent 89cc75f674
commit 55b93454dc
9 changed files with 32 additions and 35 deletions
+3 -6
View File
@@ -67,13 +67,10 @@ impl IfConfiguerTrait for MacIfConfiger {
}
async fn remove_ip(&self, name: &str, ip: Option<Ipv4Inet>) -> Result<(), Error> {
if ip.is_none() {
run_shell_cmd(format!("ifconfig {} inet delete", name).as_str()).await
if let Some(ip) = ip {
run_shell_cmd(format!("ifconfig {} inet {} delete", name, ip.address()).as_str()).await
} else {
run_shell_cmd(
format!("ifconfig {} inet {} delete", name, ip.unwrap().address()).as_str(),
)
.await
run_shell_cmd(format!("ifconfig {} inet delete", name).as_str()).await
}
}