Coverage Report

Created: 2026-09-19 07:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/rust_decimal-1.42.0/src/fuzz.rs
Line
Count
Source
1
use crate::Decimal;
2
3
use arbitrary::{Arbitrary, Result as ArbitraryResult, Unstructured};
4
5
impl Arbitrary<'_> for crate::Decimal {
6
54.1k
    fn arbitrary(u: &mut Unstructured<'_>) -> ArbitraryResult<Self> {
7
54.1k
        let lo = u32::arbitrary(u)?;
8
54.1k
        let mid = u32::arbitrary(u)?;
9
54.1k
        let hi = u32::arbitrary(u)?;
10
54.1k
        let negative = bool::arbitrary(u)?;
11
54.1k
        let scale = u32::arbitrary(u)? % (Self::MAX_SCALE + 1);
12
54.1k
        Ok(Decimal::from_parts(lo, mid, hi, negative, scale))
13
54.1k
    }
14
}