Skip to content

Commit a248231

Browse files
committed
avoid compiling unused function on windows
1 parent 4f35227 commit a248231

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/webserver/http.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ pub async fn run_server(config: &AppConfig, state: AppState) -> anyhow::Result<(
556556
{
557557
server = server
558558
.bind_uds(unix_socket)
559-
.map_err(|e| bind_unix_socket(e, unix_socket))?;
559+
.map_err(|e| bind_unix_socket_err(e, unix_socket))?;
560560
}
561561
#[cfg(not(target_family = "unix"))]
562562
anyhow::bail!("Unix sockets are not supported on your operating system. Use listen_on instead of unix_socket.");
@@ -614,7 +614,8 @@ fn bind_error(e: std::io::Error, listen_on: std::net::SocketAddr) -> anyhow::Err
614614
anyhow::anyhow!(e).context(ctx)
615615
}
616616

617-
fn bind_unix_socket(e: std::io::Error, unix_socket: &PathBuf) -> anyhow::Error {
617+
#[cfg(target_family = "unix")]
618+
fn bind_unix_socket_err(e: std::io::Error, unix_socket: &PathBuf) -> anyhow::Error {
618619
let ctx = if e.kind() == std::io::ErrorKind::PermissionDenied {
619620
format!(
620621
"You do not have permission to bind to the UNIX socket {unix_socket:?}. \

0 commit comments

Comments
 (0)