Skip to content

Commit c8bc729

Browse files
committed
Improve quickcheck impl for Duration
1 parent 83fcf11 commit c8bc729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

time/src/quickcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ impl Arbitrary for Duration {
7777

7878
fn shrink(&self) -> Box<dyn Iterator<Item = Self>> {
7979
Box::new(
80-
(self.subsec_nanoseconds_ranged(), self.whole_seconds())
80+
(self.whole_seconds(), self.subsec_nanoseconds_ranged())
8181
.shrink()
82-
.map(|(mut nanoseconds, seconds)| {
82+
.map(|(seconds, mut nanoseconds)| {
8383
// Coerce the sign if necessary.
8484
if (seconds > 0 && nanoseconds.get() < 0)
8585
|| (seconds < 0 && nanoseconds.get() > 0)

0 commit comments

Comments
 (0)