Skip to content

Commit

Permalink
Merge pull request #432 from Mingun/feature-requirements-in-docs
Browse files Browse the repository at this point in the history
Show required features in the docs on docs.rs
  • Loading branch information
dralley committed Jul 20, 2022
2 parents b456b5a + 51f5b26 commit ebbcce0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Expand Up @@ -102,7 +102,11 @@ serialize = ["serde"]
escape-html = []

[package.metadata.docs.rs]
# document all features
all-features = true
# defines the configuration attribute `docs_rs` to enable feature requirements
# See https://stackoverflow.com/questions/61417452
rustdoc-args = ["--cfg", "docs_rs"]

[[test]]
name = "serde_attrs"
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Expand Up @@ -38,6 +38,9 @@
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![recursion_limit = "1024"]
// Enable feature requirements in the docs from 1.57
// See https://stackoverflow.com/questions/61417452
#![cfg_attr(docs_rs, feature(doc_auto_cfg))]

#[cfg(feature = "serialize")]
pub mod de;
Expand Down

0 comments on commit ebbcce0

Please sign in to comment.