From 54cc67cbb83f61b6e3168b09701758c5b805120a Mon Sep 17 00:00:00 2001 From: andri lim Date: Fri, 19 Jul 2024 14:30:22 +0700 Subject: [PATCH] Reduce declared but unused warnings in keyed-queue (#224) --- stew/keyed_queue.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stew/keyed_queue.nim b/stew/keyed_queue.nim index 4f9f0eb..f1d4fae 100644 --- a/stew/keyed_queue.nim +++ b/stew/keyed_queue.nim @@ -272,7 +272,7 @@ proc append*[K, V](rq: var KeyedQueue[K, V], key: K, val: V): bool = ## All the items on the queue different from the one just added are ## called *previous* or *left hand* items while the item just added ## is the *right-most* item. - rq.tab.withValue(key, item): + rq.tab.withValue(key, _): return false do: rq.appendImpl(key, val) @@ -310,7 +310,7 @@ proc prepend*[K, V](rq: var KeyedQueue[K, V], key: K, val: V): bool = ## All the items on the queue different from the item just added are ## called *following* or *right hand* items while the item just added ## is the *left-most* item. - rq.tab.withValue(key, item): + rq.tab.withValue(key, _): return false do: rq.prependImpl(key, val) @@ -330,10 +330,10 @@ proc shift*[K, V](rq: var KeyedQueue[K, V]): Opt[KeyedQueuePair[K, V]] = type T = KeyedQueuePair[K, V] if 0 < rq.tab.len: rq.tab.withValue(rq.kFirst, item): - let res = Opt.some KeyedQueuePair[K, V](key: rq.kFirst, data: move(item[].data)) + let res = Opt.some T(key: rq.kFirst, data: move(item[].data)) rq.shiftImpl return res - Opt.none(KeyedQueuePair[K, V]) + Opt.none(T) proc shiftKey*[K, V](rq: var KeyedQueue[K, V]): Opt[K] = ## Similar to `shift()` but with different return value.