diff options
author | 2019-07-11 13:28:25 +0200 | |
---|---|---|
committer | 2019-07-11 13:28:25 +0200 | |
commit | a87cb2486f488666450636c9cb68f79681f5f358 (patch) | |
tree | 69d8ce0cda38b9ff7cef307fae53fd6a275df3ef /src/tq.rs | |
parent | 6a8404ac92a7d4a57188e962862c450be9b9b31a (diff) | |
download | rtic-a87cb2486f488666450636c9cb68f79681f5f358.tar.gz rtic-a87cb2486f488666450636c9cb68f79681f5f358.tar.zst rtic-a87cb2486f488666450636c9cb68f79681f5f358.zip |
change Monotonic::ratio return type to Fraction
Diffstat (limited to '')
-rw-r--r-- | src/tq.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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), }; |