Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document items behind feature flags #103

Merged
merged 2 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ itertools = "0.10"
[[example]]
name = "evtest_tokio"
required-features = ["tokio"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@

// should really be cfg(target_os = "linux") and maybe also android?
#![cfg(unix)]
// Flag items' docs' with their required feature flags, but only on docsrs so
// that local docs can still be built on stable toolchains.
// As of the time of writing, the stabilization plan is such that:
// - Once stabilized, this attribute should be replaced with #![doc(auto_cfg)]
// - Then in edition 2024, doc(auto_cfg) will become the default and the
// attribute can be removed entirely
// (see https://github.com/rust-lang/rust/pull/100883#issuecomment-1264470491)
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

// has to be first for its macro
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion src/raw_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ mod tokio_stream {
///
/// This can be used by calling [`stream.next_event().await?`](Self::next_event), or if you
/// need to pass it as a stream somewhere, the [`futures::Stream`](Stream) implementation.
/// There's also a lower-level [`poll_event`] function if you need to fetch an event from
/// There's also a lower-level [`Self::poll_event`] function if you need to fetch an event from
/// inside a `Future::poll` impl.
pub struct EventStream {
device: AsyncFd<RawDevice>,
Expand Down
2 changes: 1 addition & 1 deletion src/sync_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ mod tokio_stream {
///
/// This can be used by calling [`stream.next_event().await?`](Self::next_event), or if you
/// need to pass it as a stream somewhere, the [`futures::Stream`](Stream) implementation.
/// There's also a lower-level [`poll_event`] function if you need to fetch an event from
/// There's also a lower-level [`Self::poll_event`] function if you need to fetch an event from
/// inside a `Future::poll` impl.
pub struct EventStream {
device: AsyncFd<Device>,
Expand Down
2 changes: 1 addition & 1 deletion src/uinput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ mod tokio_stream {
///
/// This can be used by calling [`stream.next_event().await?`](Self::next_event), or if you
/// need to pass it as a stream somewhere, the [`futures::Stream`](Stream) implementation.
/// There's also a lower-level [`poll_event`] function if you need to fetch an event from
/// There's also a lower-level [`Self::poll_event`] function if you need to fetch an event from
/// inside a `Future::poll` impl.
pub struct VirtualEventStream {
device: AsyncFd<VirtualDevice>,
Expand Down