Merge rust-bitcoin/rust-bitcoin#3725: Rename private module to sealed
7725ca77c5
Rename private module to sealed (Tobin C. Harding)
Pull request description:
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.
ACKs for top commit:
apoelstra:
ACK 7725ca77c589a5215c50f1634f1b095d3e268540; successfully ran local tests; sure
Tree-SHA512: 5953686d7d22daaad8d2d59eff2338db3bb2a7765a37c08ed02ae1a4622509d628dbcb971781a6e85d750afa58609f5b058dfce6d5b4066f4f0d8ded45375b5b
This commit is contained in:
commit
ea6bf12a64
|
@ -563,7 +563,7 @@ enum DisplayStyle {
|
|||
}
|
||||
|
||||
/// 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
|
||||
/// happen it returns [`None`].
|
||||
fn checked_sum(self) -> Option<R>;
|
||||
|
@ -591,12 +591,12 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
mod private {
|
||||
mod sealed {
|
||||
use super::{Amount, SignedAmount};
|
||||
|
||||
/// 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> SumSeal<SignedAmount> for T where T: Iterator<Item = SignedAmount> {}
|
||||
impl<T> Sealed<Amount> for T where T: Iterator<Item = Amount> {}
|
||||
impl<T> Sealed<SignedAmount> for T where T: Iterator<Item = SignedAmount> {}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue