Skip to content

Commit

Permalink
Return an error on non-unix, non-windows platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Holzschuch committed Apr 23, 2024
1 parent c57995e commit 9a3b871
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/cli/src/hostname.rs
Expand Up @@ -25,8 +25,10 @@ pub fn hostname() -> io::Result<OsString> {
}
#[cfg(not(any(windows, unix)))]
{
// backup solution for systems that do not have gethostname():
Ok(OsString::from("localhost"))
Err(io::Error::new(
io::ErrorKind::Other,
"hostname could not be found on unsupported platform",
))
}
}

Expand Down

0 comments on commit 9a3b871

Please sign in to comment.