Skip to content

Commit

Permalink
Show required features in the docs on docs.rs
Browse files Browse the repository at this point in the history
Currently, this is nightly-only feature
See https://stackoverflow.com/questions/61417452
  • Loading branch information
Mingun committed Jul 19, 2022
1 parent b456b5a commit 51f5b26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 51f5b26

Please sign in to comment.