Merge rust-bitcoin/rust-bitcoin#1177: Remove accidentally-exported internal macros

94eeabfd6c Remove accidentally-exported internal macros (Martin Habovstiak)

Pull request description:

  Closes #1176

ACKs for top commit:
  sanket1729:
    reACK 94eeabfd6c
  apoelstra:
    ACK 94eeabfd6c

Tree-SHA512: 6c37c606499f1a9aa56ba6da02865de1638cbfe8fd1c45ef73ed936d9002e0079b1e5dcb13163f35a1c4effd6023692608afa32badef394b5604767d9bb9d80a
This commit is contained in:
Andrew Poelstra 2022-08-11 13:31:31 +00:00
commit 3c758c74cf
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
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::io::{self, Read, Write};
use crate::prelude::*; use crate::prelude::*;
use crate::internal_macros::write_err; 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]). /// The Threshold for deciding whether a lock time value is a height or a time (see [Bitcoin Core]).
/// ///

View File

@ -30,7 +30,7 @@ use crate::consensus::{encode, Decodable, Encodable};
use crate::hash_types::{Sighash, Txid, Wtxid}; use crate::hash_types::{Sighash, Txid, Wtxid};
use crate::VarInt; use crate::VarInt;
use crate::internal_macros::{impl_consensus_encoding, serde_string_impl, serde_struct_human_string_impl, write_err}; 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)] #[cfg(doc)]
use crate::util::sighash::SchnorrSighashType; 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 /// Impls std::error::Error for the specified type with appropriate attributes, possibly returning
/// source. /// source.
#[macro_export]
macro_rules! impl_std_error { macro_rules! impl_std_error {
// No source available // No source available
($type:ty) => { ($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::internal_macros::write_err;
use crate::impl_std_error; use crate::error::impl_std_error;
use core::fmt; use core::fmt;
use core::str::FromStr; use core::str::FromStr;
use core::convert::TryFrom; 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); impl_std_error!(ParseIntError, source);
/// Implements `TryFrom<$from> for $to` using `parse::int`, mapping the output using `fn` /// Implements `TryFrom<$from> for $to` using `parse::int`, mapping the output using `fn`
#[macro_export]
macro_rules! impl_tryfrom_str_through_int_single { macro_rules! impl_tryfrom_str_through_int_single {
($($from:ty, $to:ident $(, $fn:ident)?);*) => { ($($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` /// Implements `FromStr` and `TryFrom<{&str, String, Box<str>}> for $to` using `parse::int`, mapping the output using `fn`
/// ///
/// The `Error` type is `ParseIntError` /// The `Error` type is `ParseIntError`
#[macro_export]
macro_rules! impl_parse_str_through_int { macro_rules! impl_parse_str_through_int {
($to:ident $(, $fn:ident)?) => { ($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 { impl core::str::FromStr for $to {
type Err = $crate::error::ParseIntError; type Err = $crate::error::ParseIntError;
@ -121,3 +120,4 @@ macro_rules! impl_parse_str_through_int {
} }
} }
pub(crate) use impl_parse_str_through_int;