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`.
This commit is contained in:
Tobin C. Harding 2025-01-07 08:55:26 +11:00
parent 70a879279b
commit ffd8702cb3
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,7 @@ pub fn int<T: Integer, S: AsRef<str> + Into<InputString>>(s: S) -> Result<T, Par
///
/// If parsing the string fails then a `units::parse::ParseIntError` is returned.
#[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_from_int_infallible {
($to:ident, $inner:ident, $fn:ident) => {
$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);