Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Dec 4, 2024
1 parent 698498c commit 9311686
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rust-version = "1.63"
os_pipe = { version = "1.0.0", features = ["io_safety"], optional = true }

# Optionally depend on async-std just to provide impls for its types.
async-std = { version = ">=1.12, <=1.13", optional = true }
async-std = { version = "1.13.0", optional = true, features = ["io_safety"] }
# Optionally depend on tokio to implement traits for its types.
tokio = { version = "1.6.0", features = ["io-std", "fs", "net", "process"], optional = true }
# Optionally depend on socket2 to implement traits for its types.
Expand All @@ -48,8 +48,13 @@ features = [

[package.metadata.docs.rs]
features = ["close"]
rustdoc-args = ["--cfg", "doc_cfg"]

[features]
default = []
close = ["libc", "hermit-abi", "windows-sys"]

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(wasi_ext)',
]
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))]
// Currently supported platforms.
#![cfg(any(unix, windows, target_os = "wasi", target_os = "hermit"))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]

mod portability;
mod traits;
Expand Down Expand Up @@ -133,7 +133,7 @@ pub use portability::{
};

#[cfg(feature = "close")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "close")))]
#[cfg_attr(docsrs, doc(cfg(feature = "close")))]
pub mod example_ffi;
pub mod raw;
pub mod views;
12 changes: 6 additions & 6 deletions src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,22 +236,22 @@ unsafe impl FilelikeViewType for os_pipe::PipeReader {}
unsafe impl SocketlikeViewType for socket2::Socket {}

#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::TcpStream {}
#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::TcpListener {}
#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::UdpSocket {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixStream {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixListener {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixDatagram {}

#[cfg(feature = "mio")]
Expand Down

0 comments on commit 9311686

Please sign in to comment.