aboutsummaryrefslogtreecommitdiff
path: root/src/tq.rs
diff options
context:
space:
mode:
authorAndrey Zgarbul <zgarbul.andrey@gmail.com>2021-04-03 20:30:34 +0300
committerAndrey Zgarbul <zgarbul.andrey@gmail.com>2021-07-09 18:44:19 +0300
commite4319de3d526285381f5cc53e14f9a17d123a81a (patch)
treeb8ed1d60401f508f97e8f4cf151b295f11b79d24 /src/tq.rs
parentc67657371b9f27353caae8a8ccf6e94cd0f25110 (diff)
const generics
Diffstat (limited to 'src/tq.rs')
-rw-r--r--src/tq.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tq.rs b/src/tq.rs
index 985e0f8..cd44abe 100644
--- a/src/tq.rs
+++ b/src/tq.rs
@@ -1,5 +1,5 @@
use crate::{
- linked_list::{ArrayLength, LinkedList, Min, Node},
+ linked_list::{LinkedList, Min},
time::{Clock, Instant},
Monotonic,
};
@@ -14,16 +14,14 @@ fn unwrapper<T, E>(val: Result<T, E>) -> T {
}
}
-pub struct TimerQueue<Mono, Task, N>(pub LinkedList<NotReady<Mono, Task>, Min, N>)
+pub struct TimerQueue<Mono, Task, const N: usize>(pub LinkedList<NotReady<Mono, Task>, Min, N>)
where
Mono: Monotonic,
- N: ArrayLength<Node<NotReady<Mono, Task>>>,
Task: Copy;
-impl<Mono, Task, N> TimerQueue<Mono, Task, N>
+impl<Mono, Task, const N: usize> TimerQueue<Mono, Task, N>
where
Mono: Monotonic,
- N: ArrayLength<Node<NotReady<Mono, Task>>>,
Task: Copy,
{
pub fn new() -> Self {