From 7e045506c143511acaafaeca5095596a3d354eb1 Mon Sep 17 00:00:00 2001 From: Ethan Brierley Date: Sat, 28 Oct 2023 13:03:25 +0100 Subject: [PATCH] docs: enable `doc_auto_cfg` for docs.rs builds (#36) --- Cargo.toml | 1 + src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 2ae643e..65afc6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,4 +32,5 @@ serde_json = "1.0" [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/lib.rs b/src/lib.rs index 8ffb97d..bb41e4d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ #![doc = include_str!("../README.md")] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(not(feature = "std"), no_std)] #![forbid(unsafe_code)]