diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-28 04:07:22 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-28 04:07:22 +0200 |
commit | 7e0d0d96e4b8143509ae7d118f9e3dfc1077c468 (patch) | |
tree | 89ac493b661256884c680f6213508f999b4a43f4 /src/utils | |
parent | c1975f3cd58ef1c1e8e2105ad486619cea4ad23e (diff) | |
download | chawan-7e0d0d96e4b8143509ae7d118f9e3dfc1077c468.tar.gz |
Refactor fromJS body
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/opt.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils/opt.nim b/src/utils/opt.nim index 15100c2e..bcc4c595 100644 --- a/src/utils/opt.nim +++ b/src/utils/opt.nim @@ -101,6 +101,9 @@ template `?`*[T, E](res: Result[T, E]): auto = when typeof(result) is Result[T, E]: return x elif typeof(result).errType is E: - return err(x.error) + when E is void: + return err() + else: + return err(x.error) else: return err() |