use { crate::{size_hint, Arbitrary, Result, Unstructured}, core::time::Duration, }; impl<'a> Arbitrary<'a> for Duration { fn arbitrary(u: &mut Unstructured<'a>) -> Result { Ok(Self::new( ::arbitrary(u)?, u.int_in_range(0..=999_999_999)?, )) } #[inline] fn size_hint(depth: usize) -> (usize, Option) { size_hint::and( ::size_hint(depth), ::size_hint(depth), ) } }