From 0d64f0d2dbf5d199e75455757da436e58c0248f7 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Tue, 1 Oct 2024 08:52:07 +0100 Subject: [PATCH] div-ceil --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)