summaryrefslogtreecommitdiffstats
path: root/tokio/src/time
diff options
context:
space:
mode:
authorJuan Alvarez <j@yabit.io>2020-01-27 22:46:52 -0600
committerCarl Lerche <me@carllerche.com>2020-01-27 20:46:52 -0800
commite2230f3392901e2bfb4b26fdf0d4977ec6c8545c (patch)
treef8ca3dea72b5d2067c72a3611aa338db354236e3 /tokio/src/time
parent00e3c29e487ff05b6252be8052b7ba86f7c08202 (diff)
timer: fix out of bounds error (#2184)
Diffstat (limited to 'tokio/src/time')
-rw-r--r--tokio/src/time/wheel/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/time/wheel/mod.rs b/tokio/src/time/wheel/mod.rs
index c5f0f458..a2ef27fc 100644
--- a/tokio/src/time/wheel/mod.rs
+++ b/tokio/src/time/wheel/mod.rs
@@ -43,7 +43,7 @@ pub(crate) struct Wheel<T> {
const NUM_LEVELS: usize = 6;
/// The maximum duration of a delay
-const MAX_DURATION: u64 = 1 << (6 * NUM_LEVELS);
+const MAX_DURATION: u64 = (1 << (6 * NUM_LEVELS)) - 1;
#[derive(Debug)]
pub(crate) enum InsertError {