Исправлены clippy-замечания под gate -D warnings

This commit is contained in:
2026-05-12 12:19:47 +05:00
parent d114784d7d
commit bff9c50a6b
6 changed files with 43 additions and 39 deletions
+9 -11
View File
@@ -90,10 +90,10 @@ fn parse_allowed_ips(raw: &str, peer_cidr: &str) -> anyhow::Result<Vec<Peer>> {
if pfx != "32" {
continue;
}
if let Ok(v4) = ip.parse::<Ipv4Addr>() {
if config::ip_in_cidr(v4, peer_cidr)? {
out.push(Peer { ipv4: v4 });
}
if let Ok(v4) = ip.parse::<Ipv4Addr>()
&& config::ip_in_cidr(v4, peer_cidr)?
{
out.push(Peer { ipv4: v4 });
}
}
}
@@ -115,10 +115,10 @@ fn parse_fallback_wg_show(raw: &str, peer_cidr: &str) -> anyhow::Result<Vec<Peer
if pfx != "32" {
continue;
}
if let Ok(v4) = ip.parse::<Ipv4Addr>() {
if config::ip_in_cidr(v4, peer_cidr)? {
out.push(Peer { ipv4: v4 });
}
if let Ok(v4) = ip.parse::<Ipv4Addr>()
&& config::ip_in_cidr(v4, peer_cidr)?
{
out.push(Peer { ipv4: v4 });
}
}
}
@@ -308,9 +308,7 @@ mod tests {
"wg show all dump",
Err(anyhow::anyhow!("wg broken")),
)]);
let err = discover_peer_runtime_with_transport(&transport, "10.8.1.0/24")
.err()
.expect("err");
let err = discover_peer_runtime_with_transport(&transport, "10.8.1.0/24").expect_err("err");
assert!(err.to_string().contains("wg show all dump failed"));
}
}