From ffd8702cb312e5722601652d26a2daadeb25f147 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jan 2025 08:55:26 +1100 Subject: [PATCH 1/2] units: Hide the remaining public macros We do not want to commit to any public macros in `units`. Recently we (I at least) learned that adding `doc(hidden)` signals to users that the macro is unstable and should not be relied upon. Hide the remaining two macros so we can release 1.0 and not worry about later breaking them. With this applied there are no exported macros that are not hidden. Verify using `git grep -A 1 macro_export`. --- units/src/parse.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/units/src/parse.rs b/units/src/parse.rs index 4ad750acc..49f4064b7 100644 --- a/units/src/parse.rs +++ b/units/src/parse.rs @@ -117,6 +117,7 @@ pub fn int + Into>(s: S) -> Result { $crate::impl_tryfrom_str_from_int_infallible!(&str, $to, $inner, $fn); @@ -174,6 +175,7 @@ macro_rules! impl_tryfrom_str_from_int_infallible { /// /// All functions use the error returned by `$inner_fn`. #[macro_export] +#[doc(hidden)] // This is an 'internal' macro that should not be used outside of the `rust-bitcoin` crate. macro_rules! impl_parse_str { ($to:ty, $err:ty, $inner_fn:expr) => { $crate::impl_tryfrom_str!(&str, $to, $err, $inner_fn); From 9396041524e291203d5c86665639872f9a6246b5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jan 2025 08:58:16 +1100 Subject: [PATCH 2/2] api: Run just check-api --- api/units/all-features.txt | 2 -- api/units/alloc-only.txt | 2 -- api/units/no-features.txt | 2 -- 3 files changed, 6 deletions(-) diff --git a/api/units/all-features.txt b/api/units/all-features.txt index 4cfb244a8..0559a49bc 100644 --- a/api/units/all-features.txt +++ b/api/units/all-features.txt @@ -1220,8 +1220,6 @@ pub fn u32::from(height: bitcoin_units::block::BlockInterval) -> Self pub fn u64::from(value: bitcoin_units::fee_rate::FeeRate) -> Self pub fn u64::from(value: bitcoin_units::weight::Weight) -> Self pub fn u64::mul(self, rhs: bitcoin_units::weight::Weight) -> Self::Output -pub macro bitcoin_units::impl_parse_str! -pub macro bitcoin_units::impl_parse_str_from_int_infallible! pub mod bitcoin_units pub mod bitcoin_units::amount pub mod bitcoin_units::amount::serde diff --git a/api/units/alloc-only.txt b/api/units/alloc-only.txt index 61e5afbfd..a44702c7a 100644 --- a/api/units/alloc-only.txt +++ b/api/units/alloc-only.txt @@ -1064,8 +1064,6 @@ pub fn u32::from(height: bitcoin_units::block::BlockInterval) -> Self pub fn u64::from(value: bitcoin_units::fee_rate::FeeRate) -> Self pub fn u64::from(value: bitcoin_units::weight::Weight) -> Self pub fn u64::mul(self, rhs: bitcoin_units::weight::Weight) -> Self::Output -pub macro bitcoin_units::impl_parse_str! -pub macro bitcoin_units::impl_parse_str_from_int_infallible! pub mod bitcoin_units pub mod bitcoin_units::amount pub mod bitcoin_units::block diff --git a/api/units/no-features.txt b/api/units/no-features.txt index 367d8501a..39e957f3e 100644 --- a/api/units/no-features.txt +++ b/api/units/no-features.txt @@ -1018,8 +1018,6 @@ pub fn u32::from(height: bitcoin_units::block::BlockInterval) -> Self pub fn u64::from(value: bitcoin_units::fee_rate::FeeRate) -> Self pub fn u64::from(value: bitcoin_units::weight::Weight) -> Self pub fn u64::mul(self, rhs: bitcoin_units::weight::Weight) -> Self::Output -pub macro bitcoin_units::impl_parse_str! -pub macro bitcoin_units::impl_parse_str_from_int_infallible! pub mod bitcoin_units pub mod bitcoin_units::amount pub mod bitcoin_units::block