Normalise `KeyError` exception message (#119)
This commit is contained in:
parent
c2f0cbf0d9
commit
b3ea2c6b46
|
@ -380,14 +380,12 @@ proc delete*[K,V](rq: var KeyedQueue[K,V]; key: K):
|
||||||
## Delete the item with key `key` from the queue and returns the key-value
|
## Delete the item with key `key` from the queue and returns the key-value
|
||||||
## item pair just deleted (if any).
|
## item pair just deleted (if any).
|
||||||
if rq.tab.hasKey(key):
|
if rq.tab.hasKey(key):
|
||||||
try:
|
noKeyError("delete"):
|
||||||
let kvp = KeyedQueuePair[K,V](
|
let kvp = KeyedQueuePair[K,V](
|
||||||
key: key,
|
key: key,
|
||||||
data: rq.tab[key].data)
|
data: rq.tab[key].data)
|
||||||
rq.deleteImpl(key)
|
rq.deleteImpl(key)
|
||||||
return ok(kvp)
|
return ok(kvp)
|
||||||
except KeyError:
|
|
||||||
raiseAssert "We've checked that the key is present above"
|
|
||||||
err()
|
err()
|
||||||
|
|
||||||
proc del*[K,V](rq: var KeyedQueue[K,V]; key: K) =
|
proc del*[K,V](rq: var KeyedQueue[K,V]; key: K) =
|
||||||
|
|
Loading…
Reference in New Issue