Skip to content

Commit

Permalink
Improve quickcheck impl for Duration
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Jul 30, 2023
1 parent 83fcf11 commit c8bc729
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions time/src/quickcheck.rs
Expand Up @@ -77,9 +77,9 @@ impl Arbitrary for Duration {

fn shrink(&self) -> Box<dyn Iterator<Item = Self>> {
Box::new(
(self.subsec_nanoseconds_ranged(), self.whole_seconds())
(self.whole_seconds(), self.subsec_nanoseconds_ranged())
.shrink()
.map(|(mut nanoseconds, seconds)| {
.map(|(seconds, mut nanoseconds)| {
// Coerce the sign if necessary.
if (seconds > 0 && nanoseconds.get() < 0)
|| (seconds < 0 && nanoseconds.get() > 0)
Expand Down

0 comments on commit c8bc729

Please sign in to comment.