Skip to content

Commit 3c10117

Browse files
committed
Fix Windows compilation errors in client config
Two issues prevented compilation on Windows: 1. The `Host::Unix(_)` match arm in `get_hostname()` was not gated with `#[cfg(unix)]`, but the `Host::Unix` variant itself is conditionally compiled only on Unix. This caused E0599. 2. The `#[cfg(not(unix))]` version of `host_param()` used `Error` as the return type instead of `PgWireClientError`, causing E0412.
1 parent b41905e commit 3c10117

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/client/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ impl Host {
9090
pub(crate) fn get_hostname(&self) -> Option<String> {
9191
match self {
9292
Host::Tcp(host) => Some(host.clone()),
93+
#[cfg(unix)]
9394
Host::Unix(_) => None,
9495
}
9596
}
@@ -1092,7 +1093,7 @@ impl<'a> UrlParser<'a> {
10921093
}
10931094

10941095
#[cfg(not(unix))]
1095-
fn host_param(&mut self, s: &str) -> Result<(), Error> {
1096+
fn host_param(&mut self, s: &str) -> Result<(), PgWireClientError> {
10961097
let s = self.decode(s)?;
10971098
self.config.param("host", &s)
10981099
}

0 commit comments

Comments
 (0)