Исправлены 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
+13 -10
View File
@@ -56,7 +56,9 @@ pub fn print_status(cfg: &Config) -> anyhow::Result<()> {
}
println!("WireGuard clients:");
println!(" IP State Latest handshake RX TX Endpoint");
println!(
" IP State Latest handshake RX TX Public key Endpoint"
);
match wg::discover_peer_runtime(
target.container_pid,
&target.container_name,
@@ -87,13 +89,13 @@ pub fn print_status(cfg: &Config) -> anyhow::Result<()> {
let tx = format_bytes(rp.transfer_tx_bytes.unwrap_or(0));
let ep = rp.endpoint.clone().unwrap_or_else(|| "-".to_string());
println!(
" {:<11} {:<8} {:<19} {:<9} {:<9} {}",
ip, state, hs, rx, tx, ep
" {:<11} {:<8} {:<19} {:<9} {:<9} {:<44} {}",
ip, state, hs, rx, tx, rp.public_key, ep
);
} else {
println!(
" {:<11} {:<8} {:<19} {:<9} {:<9} -",
ip, "offline", "never", "0B", "0B"
" {:<11} {:<8} {:<19} {:<9} {:<9} {:<44} -",
ip, "offline", "never", "0B", "0B", "-"
);
}
}
@@ -427,6 +429,7 @@ fn print_swap_status(cfg: &Config) {
" fstab_exclusive: {}",
if s.fstab_exclusive { "yes" } else { "no" }
);
println!(" fstab_swap_entries: {}", s.fstab_swap_entries.len());
println!(
" swappiness_current: {}",
s.current_swappiness
@@ -556,11 +559,11 @@ fn parse_tc_filter_hits(raw: &str) -> BTreeMap<String, u64> {
let hits = parse_sent_packets(t).unwrap_or(0);
out.insert(ip, hits);
}
} else if t.contains(" success ") || t.starts_with("success ") {
if let Some(ip) = current_ip.clone() {
let hits = parse_success_packets(t).unwrap_or(0);
out.insert(ip, hits);
}
} else if (t.contains(" success ") || t.starts_with("success "))
&& let Some(ip) = current_ip.clone()
{
let hits = parse_success_packets(t).unwrap_or(0);
out.insert(ip, hits);
}
}
out