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

Enable documentation of non-default features and feature gates #261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ default = []
builder = ["derive_builder"]
unstable = []

[package.metadata.docs.rs]
all-features = true
zetanumbers marked this conversation as resolved.
Show resolved Hide resolved

[package.metadata.cargo_metadata_test]
some_field = true
other_field = "foo"
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(missing_docs)]
//! Structured access to the output of `cargo metadata` and `cargo --message-format=json`.
//! Usually used from within a `cargo-*` executable
Expand Down
3 changes: 2 additions & 1 deletion tests/selftest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ fn metadata() {
.metadata
.as_object()
.expect("package.metadata must be a table.");
assert_eq!(package_metadata.len(), 1);
// The second field is docs.rs metadata, ignore it
assert_eq!(package_metadata.len(), 2);

let value = package_metadata.get("cargo_metadata_test").unwrap();
let test_package_metadata: TestPackageMetadata = serde_json::from_value(value.clone()).unwrap();
Expand Down
Loading