intermediate minor optimization

This commit is contained in:
Ara Sadoyan
2025-10-01 13:47:30 +02:00
parent bd5fed9be0
commit 3541b20c80
2 changed files with 4 additions and 4 deletions

View File

@@ -250,8 +250,8 @@ pub fn drop_priv(user: String, group: String, http_addr: String, tls_addr: Optio
}
}
pub fn check_priv(addr: String) {
let port = SocketAddr::from_str(&addr).map(|sa| sa.port()).unwrap();
pub fn check_priv(addr: &str) {
let port = SocketAddr::from_str(addr).map(|sa| sa.port()).unwrap();
match port < 1024 {
true => {
let meta = std::fs::metadata("/proc/self").map(|m| m.uid()).unwrap();