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: reACK94eeabfd6c
apoelstra: ACK94eeabfd6c
Tree-SHA512: 6c37c606499f1a9aa56ba6da02865de1638cbfe8fd1c45ef73ed936d9002e0079b1e5dcb13163f35a1c4effd6023692608afa32badef394b5604767d9bb9d80a
This commit is contained in:
commit
3c758c74cf
|
@ -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]).
|
||||
///
|
||||
|
|
|
@ -30,7 +30,7 @@ use crate::consensus::{encode, Decodable, Encodable};
|
|||
use crate::hash_types::{Sighash, Txid, Wtxid};
|
||||
use crate::VarInt;
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue