From 379b7d0d78f833acbc0aae3eff421f31430a6920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= <00xc@protonmail.com> Date: Mon, 1 Jul 2024 10:53:14 +0200 Subject: [PATCH] Build docs.rs documentation with doc_auto_cfg When building documentation for docs.rs, use the `doc_auto_cfg` feature to highlight which crate features are required for a given API. The feature is not used when building docs locally, as it requires the nightly toolchain (which docs.rs already uses). --- Cargo.toml | 4 ++++ src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 504aa74..d4f2666 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,10 @@ repository = "https://github.com/cloudflare/sliceslice-rs" license = "MIT" keywords = ["search", "text", "string", "single", "simd"] +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [dependencies] cfg-if = "1" paste = "1" diff --git a/src/lib.rs b/src/lib.rs index 29019da..cd099db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ #![warn(missing_docs)] #![cfg_attr(feature = "stdsimd", feature(portable_simd))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] /// Substring search implementations using aarch64 architecture features. #[cfg(target_arch = "aarch64")]