/rust/registry/src/index.crates.io-6f17d22bba15001f/rust_decimal-1.35.0/src/fuzz.rs
Line | Count | Source (jump to first uncovered line) |
1 | | use crate::Decimal; |
2 | | |
3 | | use arbitrary::{Arbitrary, Result as ArbitraryResult, Unstructured}; |
4 | | |
5 | | impl Arbitrary<'_> for crate::Decimal { |
6 | 0 | fn arbitrary(u: &mut Unstructured<'_>) -> ArbitraryResult<Self> { |
7 | 0 | let lo = u32::arbitrary(u)?; |
8 | 0 | let mid = u32::arbitrary(u)?; |
9 | 0 | let hi = u32::arbitrary(u)?; |
10 | 0 | let negative = bool::arbitrary(u)?; |
11 | 0 | let scale = u32::arbitrary(u)?; |
12 | 0 | Ok(Decimal::from_parts(lo, mid, hi, negative, scale)) |
13 | 0 | } |
14 | | } |