From c7ae12fb647e039abda2dc9b074fde7431051a9d Mon Sep 17 00:00:00 2001 From: pezcore Date: Fri, 24 Mar 2023 13:22:53 -0400 Subject: [PATCH 1/3] doc: enable documentation of feature-gated items in docsrs --- Cargo.toml | 4 ++++ src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c092b04..aad9df7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,3 +54,7 @@ rand_core = { version = "0.6.4", optional = false } crate_rand = { package = "rand", version = "0.8.5", optional = false } bitcoin_hashes = "0.11.0" # enable default features for test + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/src/lib.rs b/src/lib.rs index 856ffe6..e27cb05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,7 @@ #![deny(unused_imports)] #![deny(missing_docs)] #![cfg_attr(all(not(test), not(feature = "std")), no_std)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(any(test, feature = "std"))] pub extern crate core; From 36fc016a16c62a895590b31d74a9178a6de06318 Mon Sep 17 00:00:00 2001 From: pezcore Date: Fri, 24 Mar 2023 13:26:10 -0400 Subject: [PATCH 2/3] Make reference to source BIP a hyperlink --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e27cb05..5c06d73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ //! # BIP39 Mnemonic Codes //! -//! https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki +//! Library crate implementing [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) //! #![deny(non_upper_case_globals)] From 53090ea50dbfb7b1d34af5d88e78a3531960ce4b Mon Sep 17 00:00:00 2001 From: pezcore Date: Fri, 24 Mar 2023 13:26:27 -0400 Subject: [PATCH 3/3] doc: fix reference to Vec --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 5c06d73..0e0d048 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -532,7 +532,7 @@ impl Mnemonic { /// Convert the mnemonic back to the entropy used to generate it. /// The return value is a byte array and the size. - /// Use [Mnemonic::to_entropy] (needs `std`) to get a [Vec]. + /// Use [Mnemonic::to_entropy] (needs `std`) to get a [`Vec`]. pub fn to_entropy_array(&self) -> ([u8; 33], usize) { // We unwrap errors here because this method can only be called on // values that were already previously validated.