Merge pull request #52 from pezcore/doc/feature-gated-items

Enable documentation of feature-gated items in docsrs
This commit is contained in:
Steven Roose 2023-08-27 20:30:48 -05:00 committed by GitHub
commit d6681c0871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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"]

View File

@ -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)]
@ -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;
@ -531,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<u8>].
/// Use [Mnemonic::to_entropy] (needs `std`) to get a [`Vec<u8>`].
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.