diff options
Diffstat (limited to 'src/utils/opt.nim')
-rw-r--r-- | src/utils/opt.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/opt.nim b/src/utils/opt.nim index 7dd045af..cdf69633 100644 --- a/src/utils/opt.nim +++ b/src/utils/opt.nim @@ -48,6 +48,9 @@ template ok*[E](res: var Result[void, E]) = template err*[T, E](t: type Result[T, E], e: E): Result[T, E] = Result[T, E](has: false, ex: e) +template err*[T](t: type Result[T, ref object]): auto = + t(has: false, ex: nil) + template err*[T](t: type Result[T, void]): Result[T, void] = Result[T, void](has: false) |