From 62788e213bf3f0f863408d6011cfb24b6d3338be Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Sat, 18 May 2024 09:42:23 +0900 Subject: [PATCH] docs: Add `package.metadata.docs.rs` This is to enable `doc_auto_cfg` feature with Docs.rs. --- Cargo.toml | 17 +++++++++++++++++ src/lib.rs | 1 + 2 files changed, 18 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 0e85fef2..b656d823 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,23 @@ edition = "2021" exclude = ["tests/**", "examples/**", ".github/**", "fuzz/**"] build = "src/build.rs" +[package.metadata.docs.rs] +features = [ + "aes-crypto", + "bzip2", + "chrono", + "deflate", + "deflate64", + "deflate-zlib-ng", + "lzma", + "time", + "zstd", +] +# Can be enabled when is fixed +# all-features = true +no-default-features = true +rustdoc-args = ["--cfg", "docsrs"] + [workspace.dependencies] time = { version = "0.3.36", default-features = false } diff --git a/src/lib.rs b/src/lib.rs index 35ffcaa6..f6fbb89f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ //! | ZipCrypto deprecated encryption | ✅ | ✅ | //! //! +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![warn(missing_docs)] #![allow(unexpected_cfgs)] // Needed for cfg(fuzzing) on nightly as of 2024-05-06 pub use crate::compression::{CompressionMethod, SUPPORTED_COMPRESSION_METHODS};