diff --git a/src/lib.rs b/src/lib.rs index 5354e68..65d09f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,7 +21,7 @@ mod convert { /// million years. pub fn millis(duration: Duration) -> u64 { // Round up. - let millis = (duration.subsec_nanos() + NANOS_PER_MILLI - 1) / NANOS_PER_MILLI; + let millis = duration.subsec_nanos().div_ceil(NANOS_PER_MILLI); duration .as_secs() .saturating_mul(MILLIS_PER_SEC)