Skip to content

Commit 436ceb7

Browse files
committed
fix: error.IntegerCastFailed -> error.Overflow
1 parent 8407657 commit 436ceb7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.zig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,9 +2599,11 @@ pub const Lua = opaque {
25992599
///
26002600
/// * Pops: `0`
26012601
/// * Pushes: `0`
2602-
/// * Errors: `error.IntegerCastFailed` if `T` is an integer type and the value at index doesn't fit
2602+
/// * Errors: `error.Overflow` if `T` is an integer type and the value at index doesn't fit
26032603
pub fn toNumeric(lua: *Lua, comptime T: type, index: i32) !T {
2604-
if (@typeInfo(T) == .int) return std.math.cast(T, try lua.toInteger(index)) orelse error.IntegerCastFailed;
2604+
if (@typeInfo(T) == .int) {
2605+
return std.math.cast(T, try lua.toInteger(index)) orelse error.Overflow;
2606+
}
26052607
return @floatCast(try lua.toNumber(index));
26062608
}
26072609

0 commit comments

Comments
 (0)