Skip to content

Commit

Permalink
Use #![doc_auto_cfg] to simplify documenting features
Browse files Browse the repository at this point in the history
  • Loading branch information
zjp-CN committed Mar 26, 2022
1 parent 8eaa503 commit 0253cf4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_tokio --no-deps
mv target/doc/ doc/use_tokio
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_async-std --no-deps
mv target/doc/ doc/use_async-std
RUSTDOCFLAGS="--cfg docsrs" cargo doc --features use_neovim_lib --no-deps
mv target/doc/ doc/use_neovim_lib
1 change: 0 additions & 1 deletion src/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//! E.g. when using the features `use_tokio`, you will need to run all the
//! API functions from inside the tokio runtime.
#[cfg(feature = "use_tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
pub mod tokio;

#[cfg(feature = "use_async-std")]
Expand Down
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//!
//! I've not yet worked through the details of what-to-export, but I'm quite
//! willing to consider what people need or want.
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
extern crate rmp;
extern crate rmpv;
#[macro_use]
Expand All @@ -48,9 +48,8 @@ pub use crate::{
};

#[cfg(feature = "use_tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "use_tokio")))]
pub mod compat {
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
//! A re-export of tokio-util's [`Compat`](tokio_util::compat::Compat)
pub mod tokio {
pub use tokio_util::compat::Compat;
}
Expand Down

0 comments on commit 0253cf4

Please sign in to comment.