File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,7 @@ unsafe fn init_userdata_metatable_index(state: *mut ffi::lua_State) -> Result<()
354
354
end
355
355
"# ;
356
356
protect_lua ! ( state, 0 , 1 , |state| {
357
- let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "__mlua_index" ) ) ;
357
+ let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "= __mlua_index" ) ) ;
358
358
if ret != ffi:: LUA_OK {
359
359
ffi:: lua_error( state) ;
360
360
}
@@ -405,7 +405,8 @@ unsafe fn init_userdata_metatable_newindex(state: *mut ffi::lua_State) -> Result
405
405
end
406
406
"# ;
407
407
protect_lua ! ( state, 0 , 1 , |state| {
408
- let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code. count_bytes( ) , cstr!( "__mlua_newindex" ) ) ;
408
+ let code_len = code. count_bytes( ) ;
409
+ let ret = ffi:: luaL_loadbuffer( state, code. as_ptr( ) , code_len, cstr!( "=__mlua_newindex" ) ) ;
409
410
if ret != ffi:: LUA_OK {
410
411
ffi:: lua_error( state) ;
411
412
}
You can’t perform that action at this time.
0 commit comments