Remove generic type parameter from init_userdata_metatable

This commit is contained in:
Alex Orlenko
2023-07-08 16:56:55 +01:00
parent 541139b944
commit 5127903c38
3 changed files with 28 additions and 10 deletions
+10 -1
View File
@@ -2631,12 +2631,21 @@ impl Lua {
}
}
init_userdata_metatable::<UserDataCell<T>>(
#[cfg(feature = "luau")]
let extra_init = None;
#[cfg(not(feature = "luau"))]
let extra_init: Option<&dyn Fn(*mut ffi::lua_State) -> Result<()>> = Some(&|state| {
ffi::lua_pushcfunction(state, util::userdata_destructor::<UserDataCell<T>>);
rawset_field(state, -2, "__gc")
});
init_userdata_metatable(
state,
metatable_index,
field_getters_index,
field_setters_index,
methods_index,
extra_init,
)?;
// Pop extra tables to get metatable on top of the stack