Skip to content

Commit

Permalink
make duration respect gen.size
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbla committed Sep 7, 2019
1 parent f704e94 commit abdd617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ impl Arbitrary for RangeFull {

impl Arbitrary for Duration {
fn arbitrary<G: Gen>(gen: &mut G) -> Self {
let seconds = u64::arbitrary(gen);
let seconds = u64::arbitrary(gen) % (gen.size() as u64) ;
let nanoseconds = u32::arbitrary(gen) % 1_000_000;
Duration::new(seconds, nanoseconds)
}
Expand Down

0 comments on commit abdd617

Please sign in to comment.