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:
    ACK d2a597c90d

Tree-SHA512: 38d3f590357e66d07cbd7fedff134c39e0920e076ea99cb34ba276749a14695d428345d7b0f9ec8222f7899cb57e7c97068d3b6e7b2a9be25a0278e0a1abf762
This commit is contained in:
Andrew Poelstra 2024-05-28 15:19:47 +00:00
commit 6d06a32d9c
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 7 additions and 4 deletions

View File

@ -45,14 +45,17 @@ pub mod parse;
#[cfg(feature = "alloc")]
pub mod weight;
pub use self::amount::ParseAmountError;
#[doc(inline)]
pub use self::amount::{Amount, SignedAmount};
#[cfg(feature = "alloc")]
pub use self::parse::ParseIntError;
#[cfg(feature = "alloc")]
#[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]
#[allow(unused_imports)]