units: Improve re-exports

Make an attempt to improve the ergonomics and docs clarity of the
`units` crate.

- Don't inline error type re-exports, this keeps them up in the
"Re-exports" section and saves cluttering the other inlined docs.

- Re-export and inline the docs for `FeeRate` and `Weight` same as we do
for `Amount`. This makes the "Structs" section of the docs nice except
for the exclusion of the locktime types (which cannot be helped).
This commit is contained in:
Tobin C. Harding 2024-04-03 11:37:09 +11:00
parent 6ec93ce685
commit 36ef4a62cf
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 8 additions and 1 deletions

View File

@ -46,9 +46,16 @@ pub mod parse;
pub mod weight; pub mod weight;
#[doc(inline)] #[doc(inline)]
pub use self::amount::{Amount, ParseAmountError, SignedAmount}; pub use self::amount::{Amount, SignedAmount};
pub use self::amount::ParseAmountError;
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
pub use self::parse::ParseIntError; pub use self::parse::ParseIntError;
#[cfg(feature = "alloc")]
#[doc(inline)]
pub use self::{
fee_rate::FeeRate,
weight::Weight,
};
#[rustfmt::skip] #[rustfmt::skip]
#[allow(unused_imports)] #[allow(unused_imports)]