Add Arbitrary to SignedAmount type
This commit is contained in:
parent
d7ac6af5b4
commit
3f244db19d
|
@ -1594,6 +1594,14 @@ impl core::iter::Sum for SignedAmount {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "arbitrary")]
|
||||
impl<'a> Arbitrary<'a> for SignedAmount {
|
||||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
||||
let s = i64::arbitrary(u)?;
|
||||
Ok(SignedAmount(s))
|
||||
}
|
||||
}
|
||||
|
||||
/// Calculates the sum over the iterator using checked arithmetic.
|
||||
pub trait CheckedSum<R>: private::SumSeal<R> {
|
||||
/// Calculates the sum over the iterator using checked arithmetic. If an over or underflow would
|
||||
|
|
Loading…
Reference in New Issue