simplify conditional unix compilation

This commit is contained in:
Johann150 2023-03-17 18:24:24 +01:00
parent 90a4f666fd
commit 3765f8a515
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1

View file

@ -32,9 +32,9 @@ use {
url::{Host, Url},
};
#[cfg(target_family = "unix")]
#[cfg(unix)]
use std::os::unix::fs::FileTypeExt;
#[cfg(target_family = "unix")]
#[cfg(unix)]
use tokio::net::{UnixListener, UnixStream};
static DEFAULT_PORT: u16 = 1965;
@ -101,7 +101,7 @@ fn main() {
}))
};
#[cfg(target_family = "unix")]
#[cfg(unix)]
for socketpath in &ARGS.sockets {
let arc = mimetypes.clone();
@ -191,7 +191,7 @@ fn args() -> Result<Args> {
&format!("Address to listen on (default 0.0.0.0:{DEFAULT_PORT} and [::]:{DEFAULT_PORT}; multiple occurences means listening on multiple interfaces)"),
"IP:PORT",
);
#[cfg(target_family = "unix")]
#[cfg(unix)]
opts.optmulti(
"",
"socket",