diff options
| author | Andrey Zgarbul <zgarbul.andrey@gmail.com> | 2021-04-03 20:30:34 +0300 |
|---|---|---|
| committer | Andrey Zgarbul <zgarbul.andrey@gmail.com> | 2021-07-09 18:44:19 +0300 |
| commit | e4319de3d526285381f5cc53e14f9a17d123a81a (patch) | |
| tree | b8ed1d60401f508f97e8f4cf151b295f11b79d24 /src/tq.rs | |
| parent | c67657371b9f27353caae8a8ccf6e94cd0f25110 (diff) | |
const generics
Diffstat (limited to 'src/tq.rs')
| -rw-r--r-- | src/tq.rs | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 { |
