From bec058227af277453405dc6463bdce8cfcabaa33 Mon Sep 17 00:00:00 2001 From: Gianmarco Garrisi Date: Wed, 28 Feb 2024 22:27:10 +0100 Subject: [PATCH] Build documentation for Serde in docs.rs --- Cargo.toml | 5 +++++ src/double_priority_queue/mod.rs | 1 + src/priority_queue/mod.rs | 1 + 3 files changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 652d322..2b6fe66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ edition = "2021" autocfg = "1" [dependencies] +equivalent = "1.0.1" indexmap = {version = "2", features = [], default-features = false} serde = { version = "1", optional = true } @@ -32,3 +33,7 @@ benchmarks = [] [workspace] members = ["test-nostd"] + +[package.metadata.docs.rs] +features = ["serde"] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/double_priority_queue/mod.rs b/src/double_priority_queue/mod.rs index 4cd8f14..c9ff33d 100644 --- a/src/double_priority_queue/mod.rs +++ b/src/double_priority_queue/mod.rs @@ -999,6 +999,7 @@ fn better_to_rebuild(len1: usize, len2: usize) -> bool { } #[cfg(feature = "serde")] +#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod serde { use std::cmp::{Eq, Ord}; use std::hash::{BuildHasher, Hash}; diff --git a/src/priority_queue/mod.rs b/src/priority_queue/mod.rs index e8f9c42..99bdef2 100644 --- a/src/priority_queue/mod.rs +++ b/src/priority_queue/mod.rs @@ -791,6 +791,7 @@ fn better_to_rebuild(len1: usize, len2: usize) -> bool { } #[cfg(feature = "serde")] +#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod serde { use std::cmp::{Eq, Ord}; use std::hash::{BuildHasher, Hash};