Skip to content

Commit

Permalink
merge unix and hermit code blocks to one code block
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Mar 4, 2024
1 parent c9be6e4 commit adef0a9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ impl TcpStream {
#[cfg(not(target_os = "wasi"))]
pub fn connect(addr: SocketAddr) -> io::Result<TcpStream> {
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 _) };
Expand Down

0 comments on commit adef0a9

Please sign in to comment.