From d242125ae4ae2f33575236166e137ce3b5d657e7 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 8 May 2024 11:43:29 +1000 Subject: [PATCH] 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`. --- units/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/units/src/lib.rs b/units/src/lib.rs index 393b5ced1..3273eeef6 100644 --- a/units/src/lib.rs +++ b/units/src/lib.rs @@ -45,10 +45,11 @@ pub mod parse; #[cfg(feature = "alloc")] pub mod weight; -pub use self::amount::ParseAmountError; #[doc(inline)] pub use self::amount::{Amount, SignedAmount}; +// ParseIntError is used by other modules, so we re-export it. #[cfg(feature = "alloc")] +#[doc(inline)] pub use self::parse::ParseIntError; #[cfg(feature = "alloc")] #[doc(inline)]