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:
parent
d4d9311603
commit
10ff979fbd
|
@ -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))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue