Merge rust-bitcoin/rust-bitcoin#2755: Fix units public re-exports
d2a597c90d
unit: Group re-exports (Tobin C. Harding)d242125ae4
units: Fix error re-exports (Tobin C. Harding) Pull request description: First patch is the meat and potatoes, second one is just a trivial refactor to the same code, done separately so as to make the changes in the first patch more clear. From patch 1 ``` units: Fix error re-exports Currently we re-export two error types at the crate root, this is surprising because: - Why not none or all the rest? - Why these two? Observe that the `ParseIntError` is special in that it is used by other modules so its good to have at the crate root (other errors are expected to be used with a module prefix eg, `amount::ParseError`). There is no obvious reason why `ParseAmountError` is re-exported. Comment and doc inline the `ParesIntError`, remove the re-export of the `ParseAmountError`. ``` ACKs for top commit: apoelstra: ACKd2a597c90d
Tree-SHA512: 38d3f590357e66d07cbd7fedff134c39e0920e076ea99cb34ba276749a14695d428345d7b0f9ec8222f7899cb57e7c97068d3b6e7b2a9be25a0278e0a1abf762
This commit is contained in:
commit
6d06a32d9c
|
@ -45,14 +45,17 @@ pub mod parse;
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
pub mod weight;
|
pub mod weight;
|
||||||
|
|
||||||
pub use self::amount::ParseAmountError;
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use self::amount::{Amount, SignedAmount};
|
pub use self::amount::{Amount, SignedAmount};
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
pub use self::parse::ParseIntError;
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use self::{fee_rate::FeeRate, weight::Weight};
|
#[rustfmt::skip]
|
||||||
|
pub use self::{
|
||||||
|
fee_rate::FeeRate,
|
||||||
|
// ParseIntError is used by other modules, so we re-export it.
|
||||||
|
parse::ParseIntError,
|
||||||
|
weight::Weight
|
||||||
|
};
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
|
|
Loading…
Reference in New Issue