From adef0a943f480052671a0f8ab26134eb2d43d8f4 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 4 Mar 2024 10:43:12 +0100 Subject: [PATCH] merge unix and hermit code blocks to one code block --- src/net/tcp/stream.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/net/tcp/stream.rs b/src/net/tcp/stream.rs index 3b3d61f64..608f95e99 100644 --- a/src/net/tcp/stream.rs +++ b/src/net/tcp/stream.rs @@ -88,9 +88,7 @@ impl TcpStream { #[cfg(not(target_os = "wasi"))] pub fn connect(addr: SocketAddr) -> io::Result { let socket = new_for_addr(addr)?; - #[cfg(unix)] - let stream = unsafe { TcpStream::from_raw_fd(socket) }; - #[cfg(target_os = "hermit")] + #[cfg(any(unix, target_os = "hermit"))] let stream = unsafe { TcpStream::from_raw_fd(socket) }; #[cfg(windows)] let stream = unsafe { TcpStream::from_raw_socket(socket as _) };