From 94eeabfd6c3de9102a3ba05ac2853683bb8492ad Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Tue, 9 Aug 2022 14:40:09 +0200 Subject: [PATCH] Remove accidentally-exported internal macros Closes #1176 --- src/blockdata/locktime.rs | 2 +- src/blockdata/transaction.rs | 2 +- src/error.rs | 2 +- src/parse.rs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/blockdata/locktime.rs b/src/blockdata/locktime.rs index bd5b5b42..7d63ec8a 100644 --- a/src/blockdata/locktime.rs +++ b/src/blockdata/locktime.rs @@ -28,7 +28,7 @@ use crate::consensus::encode::{self, Decodable, Encodable}; use crate::io::{self, Read, Write}; use crate::prelude::*; use crate::internal_macros::write_err; -use crate::impl_parse_str_through_int; +use crate::parse::impl_parse_str_through_int; /// The Threshold for deciding whether a lock time value is a height or a time (see [Bitcoin Core]). /// diff --git a/src/blockdata/transaction.rs b/src/blockdata/transaction.rs index 19726821..55150f69 100644 --- a/src/blockdata/transaction.rs +++ b/src/blockdata/transaction.rs @@ -32,7 +32,7 @@ use crate::hash_types::{Sighash, Txid, Wtxid}; use crate::VarInt; use crate::util::sighash::UINT256_ONE; use crate::internal_macros::{impl_consensus_encoding, serde_string_impl, serde_struct_human_string_impl, write_err}; -use crate::impl_parse_str_through_int; +use crate::parse::impl_parse_str_through_int; #[cfg(doc)] use crate::util::sighash::SchnorrSighashType; diff --git a/src/error.rs b/src/error.rs index 9a641fbe..bc027597 100644 --- a/src/error.rs +++ b/src/error.rs @@ -4,7 +4,6 @@ pub use crate::parse::ParseIntError; /// Impls std::error::Error for the specified type with appropriate attributes, possibly returning /// source. -#[macro_export] macro_rules! impl_std_error { // No source available ($type:ty) => { @@ -23,3 +22,4 @@ macro_rules! impl_std_error { } }; } +pub(crate) use impl_std_error; diff --git a/src/parse.rs b/src/parse.rs index 54f82415..49c09211 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -1,5 +1,5 @@ use crate::internal_macros::write_err; -use crate::impl_std_error; +use crate::error::impl_std_error; use core::fmt; use core::str::FromStr; use core::convert::TryFrom; @@ -88,7 +88,6 @@ pub(crate) fn int + Into>(s: S) -> Result for $to` using `parse::int`, mapping the output using `fn` -#[macro_export] macro_rules! impl_tryfrom_str_through_int_single { ($($from:ty, $to:ident $(, $fn:ident)?);*) => { $( @@ -102,14 +101,14 @@ macro_rules! impl_tryfrom_str_through_int_single { )* } } +pub(crate) use impl_tryfrom_str_through_int_single; /// Implements `FromStr` and `TryFrom<{&str, String, Box}> for $to` using `parse::int`, mapping the output using `fn` /// /// The `Error` type is `ParseIntError` -#[macro_export] macro_rules! impl_parse_str_through_int { ($to:ident $(, $fn:ident)?) => { - $crate::impl_tryfrom_str_through_int_single!(&str, $to $(, $fn)?; String, $to $(, $fn)?; Box, $to $(, $fn)?); + $crate::parse::impl_tryfrom_str_through_int_single!(&str, $to $(, $fn)?; String, $to $(, $fn)?; Box, $to $(, $fn)?); impl core::str::FromStr for $to { type Err = $crate::error::ParseIntError; @@ -121,3 +120,4 @@ macro_rules! impl_parse_str_through_int { } } +pub(crate) use impl_parse_str_through_int;