diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-19 20:16:39 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-19 20:17:06 +0200 |
commit | 82fb1f70ab275884c42dd769b2af8f9df5389e88 (patch) | |
tree | b7a83ca2e2d22e926959f2525169f2a2e4530e38 /src/utils | |
parent | 070cfca46f60c3a00fe6dd66457f454a1a217897 (diff) | |
download | chawan-82fb1f70ab275884c42dd769b2af8f9df5389e88.tar.gz |
Get rid of the .jserr pragma
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/opt.nim | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/utils/opt.nim b/src/utils/opt.nim index 3766516b..1a86af8e 100644 --- a/src/utils/opt.nim +++ b/src/utils/opt.nim @@ -84,9 +84,6 @@ func error*[T, E](res: Result[T, E]): E {.inline.} = res.ex template valType*[T, E](res: type Result[T, E]): auto = T template errType*[T, E](res: type Result[T, E]): auto = E -func isSameErr[T, E, F](a: type Result[T, E], b: type F): bool = - return E is F - template `?`*[T, E](res: Result[T, E]): auto = let x = res # for when res is a funcall if x.has: @@ -97,7 +94,7 @@ template `?`*[T, E](res: Result[T, E]): auto = else: when typeof(result) is Result[T, E]: return x - elif isSameErr(typeof(result), E): + elif typeof(result).errType is E: return err(x.error) else: return err() |