Исправлены clippy-замечания под gate -D warnings
This commit is contained in:
+9
-11
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user