From f939572a41fc01f03dd239d72c52fdeba3456274 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Fri, 3 Mar 2023 18:49:04 -0800 Subject: [PATCH] docs: Add indicators for methods that are std-only (#53) * docs: Add std-only indications * Module-level doc * fmt --- Cargo.toml | 4 ++++ src/lib.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6d2954c..88d800b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,3 +30,7 @@ getrandom = { version = "0.2", features = ["js"] } rand = "0.8" wyhash = "0.5" getrandom = "0.2" + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/lib.rs b/src/lib.rs index cefac4a..dda460b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,6 +72,7 @@ //! the [`with_seed`](Rng::with_seed) method. #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(docsrs, feature(doc_cfg))] #![forbid(unsafe_code)] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] @@ -79,6 +80,7 @@ use core::convert::{TryFrom, TryInto}; use core::ops::{Bound, RangeBounds}; #[cfg(feature = "std")] +#[cfg_attr(docsrs, doc(cfg(feature = "std")))] mod global_rng; #[cfg(feature = "std")]