Remove accidentally-exported internal macros

Closes #1176
This commit is contained in:
Martin Habovstiak 2022-08-09 14:40:09 +02:00
parent 9a606fc68a
commit 94eeabfd6c
4 changed files with 7 additions and 7 deletions

View File

@ -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]).
///

View File

@ -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;

View File

@ -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;

View File

@ -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<T: Integer, S: AsRef<str> + Into<String>>(s: S) -> Result<T, P
impl_std_error!(ParseIntError, source);
/// Implements `TryFrom<$from> 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<str>}> 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<str>, $to $(, $fn)?);
$crate::parse::impl_tryfrom_str_through_int_single!(&str, $to $(, $fn)?; String, $to $(, $fn)?; Box<str>, $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;