diff --git a/src/lib.rs b/src/lib.rs index 2c96bbdcd..355aeac7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -130,35 +130,35 @@ extern crate alloc; #[cfg(any(test, feature = "std"))] extern crate core; +mod error; +/// Re-exports the hrp types from [`primitives::hrp`] to make importing ergonomic for the top level APIs. +pub mod hrp; +/// All the primitive types and functionality used in encoding and decoding. +pub mod primitives; +/// API for encoding and decoding segwit addresses. +pub mod segwit; + #[cfg(all(feature = "alloc", not(feature = "std"), not(test)))] use alloc::{string::String, vec::Vec}; use core::fmt; use crate::error::write_err; -#[doc(inline)] -pub use crate::primitives::checksum::Checksum; #[cfg(doc)] use crate::primitives::decode::CheckedHrpstring; #[cfg(feature = "alloc")] use crate::primitives::decode::UncheckedHrpstringError; #[cfg(feature = "alloc")] use crate::primitives::decode::{ChecksumError, UncheckedHrpstring}; -#[doc(inline)] -pub use crate::primitives::gf32::Fe32; -#[doc(inline)] -pub use crate::primitives::hrp::Hrp; -#[doc(inline)] -pub use crate::primitives::iter::{ByteIterExt, Fe32IterExt}; -#[doc(inline)] -pub use crate::primitives::{Bech32, Bech32m, NoChecksum}; -mod error; -/// Re-exports the hrp types from [`primitives::hrp`] to make importing ergonomic for the top level APIs. -pub mod hrp; -/// All the primitive types and functionality used in encoding and decoding. -pub mod primitives; -/// API for encoding and decoding segwit addresses. -pub mod segwit; +#[rustfmt::skip] // Keep public re-exports separate. +#[doc(inline)] +pub use { + crate::primitives::checksum::Checksum, + crate::primitives::gf32::Fe32, + crate::primitives::hrp::Hrp, + crate::primitives::iter::{ByteIterExt, Fe32IterExt}, + crate::primitives::{Bech32, Bech32m, NoChecksum}, +}; /// Decodes a bech32 encoded string. /// diff --git a/src/segwit.rs b/src/segwit.rs index f66451737..db2ff263b 100644 --- a/src/segwit.rs +++ b/src/segwit.rs @@ -53,10 +53,14 @@ use crate::primitives::iter::{ByteIterExt, Fe32IterExt}; #[cfg(feature = "alloc")] use crate::primitives::segwit; use crate::primitives::segwit::{InvalidWitnessVersionError, WitnessLengthError}; -#[doc(inline)] -pub use crate::primitives::segwit::{VERSION_0, VERSION_1}; use crate::primitives::{Bech32, Bech32m}; +#[rustfmt::skip] // Keep public re-exports separate. +#[doc(inline)] +pub use { + crate::primitives::segwit::{VERSION_0, VERSION_1}, +}; + /// Decodes a segwit address. /// /// # Examples