From a87cb2486f488666450636c9cb68f79681f5f358 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 11 Jul 2019 13:28:25 +0200 Subject: change Monotonic::ratio return type to Fraction --- src/tq.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tq.rs') diff --git a/src/tq.rs b/src/tq.rs index 4f9b6e7..4edb40a 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -62,11 +62,11 @@ where // set a new timeout const MAX: u32 = 0x00ffffff; - let dur = match (instant - now) - .try_into() - .ok() - .and_then(|x| x.checked_mul(M::ratio())) - { + let ratio = M::ratio(); + let dur = match (instant - now).try_into().ok().and_then(|x| { + x.checked_mul(ratio.numerator) + .map(|x| x / ratio.denominator) + }) { None => MAX, Some(x) => cmp::min(MAX, x), }; -- cgit v1.2.3