2024-02-06 16:37:42 +00:00
|
|
|
import chronos
|
|
|
|
|
|
|
|
template assertResultOk*[T, E](result: Result[T, E]) =
|
2024-05-13 15:43:14 +00:00
|
|
|
assert result.isOk(), $result.error()
|
2024-08-02 14:43:22 +00:00
|
|
|
|
|
|
|
template assertResultOk*(result: Result[void, string]) =
|
|
|
|
assert result.isOk(), $result.error()
|
|
|
|
|
|
|
|
template typeEq*(t: typedesc, u: typedesc): bool =
|
|
|
|
# <a is b> is also true if a is subtype of b
|
|
|
|
t is u and u is t # Only true if actually equal types
|
|
|
|
|
|
|
|
template typeEq*(t: auto, u: typedesc): bool =
|
|
|
|
typeEq(type(t), u)
|