Rename private module to sealed

There are two `private` modules in `amount` but they do slightly
different things. One provides a private `Token` and one is for trait
sealing. We have various other trait sealing modules in the codebase and
they are all called `sealed` not `private`. Also the seal trait is
called `Sealed`.

Rename the `private` module and the trait to be uniform with the rest of
the codebase.
This commit is contained in:
Tobin C. Harding 2024-12-11 13:01:05 +11:00
parent aeca93b561
commit 7725ca77c5
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 5 additions and 5 deletions

View File

@ -563,7 +563,7 @@ enum DisplayStyle {
} }
/// Calculates the sum over the iterator using checked arithmetic. /// Calculates the sum over the iterator using checked arithmetic.
pub trait CheckedSum<R>: private::SumSeal<R> { pub trait CheckedSum<R>: sealed::Sealed<R> {
/// Calculates the sum over the iterator using checked arithmetic. If an over or underflow would /// Calculates the sum over the iterator using checked arithmetic. If an over or underflow would
/// happen it returns [`None`]. /// happen it returns [`None`].
fn checked_sum(self) -> Option<R>; fn checked_sum(self) -> Option<R>;
@ -591,12 +591,12 @@ where
} }
} }
mod private { mod sealed {
use super::{Amount, SignedAmount}; use super::{Amount, SignedAmount};
/// Used to seal the `CheckedSum` trait /// Used to seal the `CheckedSum` trait
pub trait SumSeal<A> {} pub trait Sealed<A> {}
impl<T> SumSeal<Amount> for T where T: Iterator<Item = Amount> {} impl<T> Sealed<Amount> for T where T: Iterator<Item = Amount> {}
impl<T> SumSeal<SignedAmount> for T where T: Iterator<Item = SignedAmount> {} impl<T> Sealed<SignedAmount> for T where T: Iterator<Item = SignedAmount> {}
} }