Small code improvement,

This commit is contained in:
Kavin 2023-09-29 13:00:59 +01:00
parent 3d99bdd454
commit 0edb727a03
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F

View file

@ -28,8 +28,8 @@ async fn main() -> std::io::Result<()> {
// get socket/port from env // get socket/port from env
// backwards compat when only UDS is set // backwards compat when only UDS is set
let socket_path = env::var("BIND_UNIX").unwrap_or_else(|_| "./socket/actix.sock".to_string());
if env::var("UDS").is_ok() { if env::var("UDS").is_ok() {
let socket_path = env::var("BIND_UNIX").unwrap_or_else(|_| "./socket/actix.sock".to_string());
server.bind_uds(socket_path)? server.bind_uds(socket_path)?
} else { } else {
let bind = env::var("BIND").unwrap_or_else(|_| "0.0.0.0:8080".to_string()); let bind = env::var("BIND").unwrap_or_else(|_| "0.0.0.0:8080".to_string());