clippy all codes (#1214)

1. clippy code
2. add fmt and clippy check in ci
This commit is contained in:
Sijie.Sun
2025-08-10 22:56:41 +08:00
committed by GitHub
parent 0087ac3ffc
commit e43537939a
144 changed files with 1475 additions and 1531 deletions
+4 -5
View File
@@ -34,13 +34,12 @@ impl NetNSGuard {
return;
}
let ns_path: String;
let name = name.unwrap();
if name == ROOT_NETNS_NAME {
ns_path = "/proc/1/ns/net".to_string();
let ns_path: String = if name == ROOT_NETNS_NAME {
"/proc/1/ns/net".to_string()
} else {
ns_path = format!("/var/run/netns/{}", name);
}
format!("/var/run/netns/{}", name)
};
let ns = std::fs::File::open(ns_path).unwrap();
tracing::info!(