amount: Move arbitrary impl

In an effort to make the `unsigned` and `signed` files be diff'able move
the `arbitrary` code to be in the same place.

Code move only.
This commit is contained in:
Tobin C. Harding 2024-10-31 11:45:39 +11:00
parent d4d9311603
commit 10ff979fbd
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 8 additions and 8 deletions

View File

@ -264,14 +264,6 @@ impl Amount {
} }
} }
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for Amount {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let a = u64::arbitrary(u)?;
Ok(Amount(a))
}
}
impl default::Default for Amount { impl default::Default for Amount {
fn default() -> Self { Amount::ZERO } fn default() -> Self { Amount::ZERO }
} }
@ -387,3 +379,11 @@ impl core::iter::Sum for Amount {
Amount::from_sat(sats) Amount::from_sat(sats)
} }
} }
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for Amount {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let a = u64::arbitrary(u)?;
Ok(Amount(a))
}
}