Skip to content

Commit

Permalink
Minor cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Aug 15, 2023
1 parent 50de40c commit 5118101
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/wasi/src/preview2/host/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ impl<T: WasiView> tcp::Host for T {
let value = value.try_into().unwrap();
Ok(value)
}
Err(err) => return Err(err.into()),
Err(err) => Err(err.into()),
}
}

Expand All @@ -496,7 +496,7 @@ impl<T: WasiView> tcp::Host for T {
Err(rustix::io::Errno::NOPROTOOPT) => {
Ok(sockopt::set_ip_ttl(socket.tcp_socket(), value.into())?)
}
Err(err) => return Err(err.into()),
Err(err) => Err(err.into()),
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/wasi/src/preview2/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ pub(crate) enum HostTcpState {
pub(crate) struct HostTcpSocket(pub(crate) Arc<HostTcpSocketInner>);

pub(crate) struct HostTcpSocketInner {
// On Unix-family platforms we can use `AsyncFd` for efficient polling.
#[cfg(unix)]
pub(crate) tcp_socket: tokio::io::unix::AsyncFd<cap_std::net::TcpListener>,

// Otherwise, we can use plain `poll`.
#[cfg(not(unix))]
pub(crate) tcp_socket: cap_std::net::TcpListener,

Expand Down

0 comments on commit 5118101

Please sign in to comment.