From c7ae12fb647e039abda2dc9b074fde7431051a9d Mon Sep 17 00:00:00 2001 From: pezcore Date: Fri, 24 Mar 2023 13:22:53 -0400 Subject: [PATCH] doc: enable documentation of feature-gated items in docsrs --- Cargo.toml | 4 ++++ src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c092b04..aad9df7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,3 +54,7 @@ rand_core = { version = "0.6.4", optional = false } crate_rand = { package = "rand", version = "0.8.5", optional = false } bitcoin_hashes = "0.11.0" # enable default features for test + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/lib.rs b/src/lib.rs index 856ffe6..e27cb05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,7 @@ #![deny(unused_imports)] #![deny(missing_docs)] #![cfg_attr(all(not(test), not(feature = "std")), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(any(test, feature = "std"))] pub extern crate core;