about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-19 20:16:39 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-19 20:17:06 +0200
commit82fb1f70ab275884c42dd769b2af8f9df5389e88 (patch)
treeb7a83ca2e2d22e926959f2525169f2a2e4530e38 /src/utils
parent070cfca46f60c3a00fe6dd66457f454a1a217897 (diff)
downloadchawan-82fb1f70ab275884c42dd769b2af8f9df5389e88.tar.gz
Get rid of the .jserr pragma
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/opt.nim5
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()