Skip to content

Commit 41cf1bc

Browse files
committed
Merge #131: Make write_err macro private
98ea514 Make write_err macro private (Tobin C. Harding) Pull request description: Currently the `write_err` macro appears in the public API, there is no real benefit in this, its just one more thing to commit to post v1.0.0 Make the `write_err` macro private. ACKs for top commit: clarkmoody: ACK 98ea514 apoelstra: ACK 98ea514 Tree-SHA512: 8bd434bf81fe3f86da9f80d48ee0d6149b3f6b0169d2db2dc9d4cee00946b0a5025cc5e6b44ece90a610e67a6e4c5775559d3b8d19555db3e6e2e912bd0b1bb1
2 parents 175df94 + 98ea514 commit 41cf1bc

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
/// If `std` feature is OFF appends error source (delimited by `: `). We do this because
66
/// `e.source()` is only available in std builds, without this macro the error source is lost for
77
/// no-std builds.
8-
#[macro_export]
98
macro_rules! write_err {
109
($writer:expr, $string:literal $(, $args:expr)*; $source:expr) => {
1110
{
@@ -21,3 +20,4 @@ macro_rules! write_err {
2120
}
2221
}
2322
}
23+
pub(crate) use write_err;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use alloc::{string::String, vec::Vec};
3333
use core::convert::{Infallible, TryFrom};
3434
use core::{fmt, mem};
3535

36+
use crate::error::write_err;
3637
pub use crate::primitives::checksum::Checksum;
3738
use crate::primitives::checksum::{self, PackedFe32};
3839
pub use crate::primitives::gf32::Fe32;

src/primitives/decode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@
7575
7676
use core::{fmt, iter, slice, str};
7777

78+
use crate::error::write_err;
7879
use crate::primitives::checksum::{self, Checksum};
7980
use crate::primitives::gf32::Fe32;
8081
use crate::primitives::hrp::{self, Hrp};
8182
use crate::primitives::iter::{Fe32IterExt, FesToBytes};
8283
use crate::primitives::segwit::{self, WitnessLengthError, VERSION_0};
83-
use crate::{write_err, Bech32, Bech32m};
84+
use crate::{Bech32, Bech32m};
8485

8586
/// Separator between the hrp and payload (as defined by BIP-173).
8687
const SEP: char = '1';

src/primitives/gf32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use core::{fmt, num, ops};
1616
#[cfg(all(test, mutate))]
1717
use mutagen::mutate;
1818

19-
use crate::write_err;
19+
use crate::error::write_err;
2020

2121
/// Logarithm table of each bech32 element, as a power of alpha = Z.
2222
///

src/segwit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
use alloc::{string::String, vec::Vec};
4646
use core::fmt;
4747

48+
use crate::error::write_err;
4849
#[cfg(feature = "alloc")]
4950
use crate::primitives::decode::{SegwitHrpstring, SegwitHrpstringError};
5051
use crate::primitives::gf32::Fe32;
@@ -53,7 +54,6 @@ use crate::primitives::iter::{ByteIterExt, Fe32IterExt};
5354
use crate::primitives::segwit::{self, InvalidWitnessVersionError, WitnessLengthError};
5455
pub use crate::primitives::segwit::{VERSION_0, VERSION_1};
5556
use crate::primitives::{Bech32, Bech32m};
56-
use crate::write_err;
5757

5858
/// Decodes a segwit address.
5959
///

0 commit comments

Comments
 (0)