From c1bcb8a4d833d035eb199546aabc44dbe10252c6 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 26 Apr 2024 16:19:09 +0200 Subject: 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. --- src/js/fromjs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/fromjs.nim') 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 -- cgit 1.4.1-2-gfad0