mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
simplify conditional unix compilation
This commit is contained in:
parent
90a4f666fd
commit
3765f8a515
1 changed files with 4 additions and 4 deletions
|
|
@ -32,9 +32,9 @@ use {
|
||||||
url::{Host, Url},
|
url::{Host, Url},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(unix)]
|
||||||
use std::os::unix::fs::FileTypeExt;
|
use std::os::unix::fs::FileTypeExt;
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(unix)]
|
||||||
use tokio::net::{UnixListener, UnixStream};
|
use tokio::net::{UnixListener, UnixStream};
|
||||||
|
|
||||||
static DEFAULT_PORT: u16 = 1965;
|
static DEFAULT_PORT: u16 = 1965;
|
||||||
|
|
@ -101,7 +101,7 @@ fn main() {
|
||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(unix)]
|
||||||
for socketpath in &ARGS.sockets {
|
for socketpath in &ARGS.sockets {
|
||||||
let arc = mimetypes.clone();
|
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)"),
|
&format!("Address to listen on (default 0.0.0.0:{DEFAULT_PORT} and [::]:{DEFAULT_PORT}; multiple occurences means listening on multiple interfaces)"),
|
||||||
"IP:PORT",
|
"IP:PORT",
|
||||||
);
|
);
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(unix)]
|
||||||
opts.optmulti(
|
opts.optmulti(
|
||||||
"",
|
"",
|
||||||
"socket",
|
"socket",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue