aboutsummaryrefslogtreecommitdiff
path: root/src/tq.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-11 13:28:25 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-07-11 13:28:25 +0200
commita87cb2486f488666450636c9cb68f79681f5f358 (patch)
tree69d8ce0cda38b9ff7cef307fae53fd6a275df3ef /src/tq.rs
parent6a8404ac92a7d4a57188e962862c450be9b9b31a (diff)
downloadrtic-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.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tq.rs b/src/tq.rs
index 4f9b6e7e..4edb40a7 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),
};
'jarred/wip-more-reliable'>jarred/wip-more-reliable Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/esm (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-22Slightly customize the `events` polyfill so it uses ESMGravatar Jarred Sumner 1-1/+522
2022-06-22Fix memory bugs in escapeHTML & arrayBufferToStringGravatar Jarred Sumner 1-65/+61