units: Make amount::error module private

The `untis::error` module is just a code organisation thing it should
never have been public. We already re-export all the error types and
this is verified by the `units/tests/api.rs` test file.

Make the module private and remove it from the paths in the `api` test.
This commit is contained in:
Tobin C. Harding 2024-12-23 14:28:14 +11:00
parent 35f1e8641f
commit 760f0715dd
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 12 additions and 21 deletions

View File

@ -5,7 +5,7 @@
//! This module mainly introduces the [`Amount`] and [`SignedAmount`] types. //! This module mainly introduces the [`Amount`] and [`SignedAmount`] types.
//! We refer to the documentation on the types for more information. //! We refer to the documentation on the types for more information.
pub mod error; mod error;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
pub mod serde; pub mod serde;

View File

@ -124,17 +124,17 @@ struct Errors {
i: amount::PossiblyConfusingDenominationError, i: amount::PossiblyConfusingDenominationError,
j: amount::TooPreciseError, j: amount::TooPreciseError,
k: amount::UnknownDenominationError, k: amount::UnknownDenominationError,
l: amount::error::InputTooLargeError, l: amount::InputTooLargeError,
m: amount::error::InvalidCharacterError, m: amount::InvalidCharacterError,
n: amount::error::MissingDenominationError, n: amount::MissingDenominationError,
o: amount::error::MissingDigitsError, o: amount::MissingDigitsError,
p: amount::error::OutOfRangeError, p: amount::OutOfRangeError,
q: amount::error::ParseAmountError, q: amount::ParseAmountError,
r: amount::error::ParseDenominationError, r: amount::ParseDenominationError,
s: amount::error::ParseError, s: amount::ParseError,
t: amount::error::PossiblyConfusingDenominationError, t: amount::PossiblyConfusingDenominationError,
u: amount::error::TooPreciseError, u: amount::TooPreciseError,
v: amount::error::UnknownDenominationError, v: amount::UnknownDenominationError,
w: block::TooBigForRelativeBlockHeightError, w: block::TooBigForRelativeBlockHeightError,
x: locktime::absolute::ConversionError, x: locktime::absolute::ConversionError,
y: locktime::absolute::Height, y: locktime::absolute::Height,
@ -166,15 +166,6 @@ fn api_can_use_all_types_from_module_amount() {
}; };
} }
#[test]
fn api_can_use_all_types_from_module_amount_error() {
use bitcoin_units::amount::error::{
InputTooLargeError, InvalidCharacterError, MissingDenominationError, MissingDigitsError,
OutOfRangeError, ParseAmountError, ParseDenominationError, ParseError,
PossiblyConfusingDenominationError, TooPreciseError, UnknownDenominationError,
};
}
#[test] #[test]
fn api_can_use_all_types_from_module_block() { fn api_can_use_all_types_from_module_block() {
use bitcoin_units::block::{BlockHeight, BlockInterval, TooBigForRelativeBlockHeightError}; use bitcoin_units::block::{BlockHeight, BlockInterval, TooBigForRelativeBlockHeightError};