From 8e96abae39281e0cccd60ac6e8cd1a0b913f9334 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 9 Sep 2021 18:49:47 +1000 Subject: [PATCH] Make `key` module private We re-export all structs residing in that module. There is no reason to expose the internal module structure of the library publicly. --- src/lib.rs | 4 +++- src/secret.rs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dc4092e..1a99aa7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -143,9 +143,10 @@ mod macros; #[macro_use] mod secret; mod context; +mod key; + pub mod constants; pub mod ecdh; -pub mod key; pub mod schnorrsig; #[cfg(feature = "recovery")] pub mod recovery; @@ -154,6 +155,7 @@ mod serde_util; pub use key::SecretKey; pub use key::PublicKey; +pub use key::ONE_KEY; pub use context::*; use core::marker::PhantomData; use core::ops::Deref; diff --git a/src/secret.rs b/src/secret.rs index 34153c2..f7fc22e 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -90,7 +90,7 @@ impl SecretKey { /// # Example /// /// ``` - /// use secp256k1::key::ONE_KEY; + /// use secp256k1::ONE_KEY; /// let key = ONE_KEY; /// // Normal display hides value /// assert_eq!( @@ -123,7 +123,7 @@ impl KeyPair { /// # Example /// /// ``` - /// use secp256k1::key::ONE_KEY; + /// use secp256k1::ONE_KEY; /// use secp256k1::schnorrsig::KeyPair; /// use secp256k1::Secp256k1; ///