From 10ff979fbd76232ab28127600b7515bcf86467b9 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 31 Oct 2024 11:45:39 +1100 Subject: [PATCH] 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. --- units/src/amount/unsigned.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/units/src/amount/unsigned.rs b/units/src/amount/unsigned.rs index f638a1e13..46738bbd7 100644 --- a/units/src/amount/unsigned.rs +++ b/units/src/amount/unsigned.rs @@ -264,14 +264,6 @@ impl Amount { } } -#[cfg(feature = "arbitrary")] -impl<'a> Arbitrary<'a> for Amount { - fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result { - let a = u64::arbitrary(u)?; - Ok(Amount(a)) - } -} - impl default::Default for Amount { fn default() -> Self { Amount::ZERO } } @@ -387,3 +379,11 @@ impl core::iter::Sum for Amount { Amount::from_sat(sats) } } + +#[cfg(feature = "arbitrary")] +impl<'a> Arbitrary<'a> for Amount { + fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result { + let a = u64::arbitrary(u)?; + Ok(Amount(a)) + } +}