From 747e1f7703f43f623543a64f7ce8afb6e13a6614 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Sun, 13 Aug 2023 18:32:32 +0900 Subject: [PATCH] Enable `doc_auto_cfg` feature This allows an API be documented as only available when the feature is enabled. This is useful when reading the document published on docs.rs. --- Cargo.toml | 4 ++-- src/lib.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e05bd1aa..64e57e2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,8 +80,8 @@ no_neon = [] zeroize = ["zeroize_crate", "arrayvec/zeroize"] [package.metadata.docs.rs] -# Document Hasher::update_rayon on docs.rs. -features = ["rayon"] +features = ["rayon", "traits-preview", "zeroize"] +rustdoc-args = ["--cfg", "doc_cfg"] [dependencies] arrayref = "0.3.5" diff --git a/src/lib.rs b/src/lib.rs index e2a4d9c7..a5337e3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,6 +66,7 @@ //! [`signature`]: https://crates.io/crates/signature #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(doc_cfg, feature(doc_auto_cfg, doc_cfg))] #[cfg(feature = "zeroize")] extern crate zeroize_crate as zeroize; // Needed because `zeroize::Zeroize` assumes the crate is named `zeroize`.