From 36ef4a62cfff2d2830d9fe055a8af8be97afa4c1 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 3 Apr 2024 11:37:09 +1100 Subject: [PATCH] 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). --- units/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/units/src/lib.rs b/units/src/lib.rs index 0da62a64..b2c27879 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -46,9 +46,16 @@ pub mod parse; pub mod weight; #[doc(inline)] -pub use self::amount::{Amount, ParseAmountError, SignedAmount}; +pub use self::amount::{Amount, SignedAmount}; +pub use self::amount::ParseAmountError; #[cfg(feature = "alloc")] pub use self::parse::ParseIntError; +#[cfg(feature = "alloc")] +#[doc(inline)] +pub use self::{ + fee_rate::FeeRate, + weight::Weight, +}; #[rustfmt::skip] #[allow(unused_imports)]