Skip to content

Commit 3366f47

Browse files
committed
Minor Lua 5.2 fixes
1 parent 0b5ef91 commit 3366f47

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

mlua-sys/src/lua52/compat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub unsafe fn lua_rawget(L: *mut lua_State, idx: c_int) -> c_int {
125125

126126
#[inline(always)]
127127
pub unsafe fn lua_rawgeti(L: *mut lua_State, idx: c_int, n: lua_Integer) -> c_int {
128-
let n = n.try_into().expect("cannot convert index to lua_Integer");
128+
let n = n.try_into().expect("cannot convert index to c_int");
129129
lua_rawgeti_(L, idx, n);
130130
lua_type(L, -1)
131131
}
@@ -153,7 +153,7 @@ pub unsafe fn lua_seti(L: *mut lua_State, mut idx: c_int, n: lua_Integer) {
153153

154154
#[inline(always)]
155155
pub unsafe fn lua_rawseti(L: *mut lua_State, idx: c_int, n: lua_Integer) {
156-
let n = n.try_into().expect("cannot convert index from lua_Integer");
156+
let n = n.try_into().expect("cannot convert index to c_int");
157157
lua_rawseti_(L, idx, n)
158158
}
159159

mlua-sys/src/lua52/lauxlib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ pub unsafe fn luaL_getmetatable(L: *mut lua_State, n: *const c_char) {
166166
lua::lua_getfield_(L, lua::LUA_REGISTRYINDEX, n);
167167
}
168168

169-
// luaL_opt would be implemented here but it is undocumented, so it's omitted
170-
171169
#[inline(always)]
172170
pub unsafe fn luaL_loadbuffer(L: *mut lua_State, s: *const c_char, sz: usize, n: *const c_char) -> c_int {
173171
luaL_loadbufferx(L, s, sz, n, ptr::null())

0 commit comments

Comments
 (0)