about summary refs log tree commit diff stats
path: root/src/js/fromjs.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-26 16:19:09 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-26 16:24:27 +0200
commitc1bcb8a4d833d035eb199546aabc44dbe10252c6 (patch)
tree4a2acaadf7f4ef4d4ccb32e3e6e558141d26d73e /src/js/fromjs.nim
parentd93c5700d432afc265fab1fbfef663f77361635d (diff)
downloadchawan-c1bcb8a4d833d035eb199546aabc44dbe10252c6.tar.gz
Remove unnecessary unsigned casts
Unsigned operations and conversions to unsigned types always wrap/narrow
without checks, so no need to manually mask/cast/etc. them.
Diffstat (limited to 'src/js/fromjs.nim')
-rw-r--r--src/js/fromjs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim
index 4cdc18d1..527b6221 100644
--- a/src/js/fromjs.nim
+++ b/src/js/fromjs.nim
@@ -108,7 +108,7 @@ func fromJSInt[T: SomeInteger](ctx: JSContext; val: JSValue):
     var ret: uint32
     if JS_ToUint32(ctx, addr ret, val) < 0:
       return err()
-    return ok(cast[uint64](ret))
+    return ok(uint64(ret))
 
 proc fromJSFloat64(ctx: JSContext; val: JSValue): JSResult[float64] =
   var f64: float64