Skip to content

Commit 8407657

Browse files
committed
fix: remove pushNumeric from test, typo in toNumeric
1 parent ffa2205 commit 8407657

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ pub const Lua = opaque {
26012601
/// * Pushes: `0`
26022602
/// * Errors: `error.IntegerCastFailed` 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(try lua.toInteger(index)) orelse error.IntegerCastFailed;
2604+
if (@typeInfo(T) == .int) return std.math.cast(T, try lua.toInteger(index)) orelse error.IntegerCastFailed;
26052605
return @floatCast(try lua.toNumber(index));
26062606
}
26072607

src/tests.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3061,7 +3061,7 @@ test "pushNumeric and toNumeric" {
30613061
defer lua.deinit();
30623062

30633063
const num: u32 = 100;
3064-
lua.pushNumeric(num);
3064+
lua.pushInteger(num);
30653065
const pull = lua.toNumeric(u32, lua.getTop());
30663066
try std.testing.expectEqual(num, pull);
30673067
}

0 commit comments

Comments
 (0)