Merge rust-bitcoin/rust-secp256k1#365: Fixed docs(rs)

314e8755df Clarify `global-context` feature (Martin Habovstiak)
d52ab85dd5 Added missing features to docs.rs config (Martin Habovstiak)

Pull request description:

  Sadly, I missed two details in #353: features missing in docs.rs configuration and `global-context` being a bit confusing.
  This PR fixes those, see commit messages for details.

ACKs for top commit:
  apoelstra:
    ACK 314e8755df

Tree-SHA512: 01bed8ae2f30adcbdd436b514f08a084492d7f4e1a739ca62e6d8b8547e379c01faeda3522733c27ab615acbb4c6cff60e13906cc88a0d2b90e439e7da517466
This commit is contained in:
Andrew Poelstra 2022-01-07 17:31:30 +00:00
commit d068fd7d41
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ autoexamples = false # Remove when edition 2018 https://github.com/rust-lang/car
# Should make docs.rs show all functions, even those behind non-default features # Should make docs.rs show all functions, even those behind non-default features
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = [ "rand", "rand-std", "serde", "recovery" ] features = [ "rand", "rand-std", "serde", "bitcoin_hashes", "recovery", "global-context" ]
rustdoc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"]
[features] [features]

View File

@ -10,7 +10,7 @@ use Secp256k1;
pub use self::alloc_only::*; pub use self::alloc_only::*;
#[cfg(feature = "global-context-less-secure")] #[cfg(feature = "global-context-less-secure")]
#[cfg_attr(docsrs, doc(cfg(feature = "global-context-less-secure")))] #[cfg_attr(docsrs, doc(cfg(any(feature = "global-context", feature = "global-context-less-secure"))))]
/// Module implementing a singleton pattern for a global `Secp256k1` context /// Module implementing a singleton pattern for a global `Secp256k1` context
pub mod global { pub mod global {
#[cfg(feature = "global-context")] #[cfg(feature = "global-context")]

View File

@ -190,7 +190,7 @@ use core::{mem, fmt, str};
use ffi::{CPtr, types::AlignedType}; use ffi::{CPtr, types::AlignedType};
#[cfg(feature = "global-context-less-secure")] #[cfg(feature = "global-context-less-secure")]
#[cfg_attr(docsrs, doc(cfg(feature = "global-context-less-secure")))] #[cfg_attr(docsrs, doc(cfg(any(feature = "global-context", feature = "global-context-less-secure"))))]
pub use context::global::SECP256K1; pub use context::global::SECP256K1;
#[cfg(feature = "bitcoin_hashes")] #[cfg(feature = "bitcoin_hashes")]