Add `push_closure`
This commit is contained in:
parent
cf37264d9a
commit
64ade67496
|
@ -109,7 +109,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gmod"
|
||||
version = "15.0.1"
|
||||
version = "15.0.2"
|
||||
dependencies = [
|
||||
"cfg_table",
|
||||
"cstr",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "gmod"
|
||||
version = "15.0.1"
|
||||
version = "15.0.2"
|
||||
authors = ["William Venner <william@venner.io>"]
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
|
|
@ -315,6 +315,12 @@ impl LuaState {
|
|||
(LUA_SHARED.lua_pushcclosure)(*self, func, 0)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub unsafe fn push_closure(&self, func: LuaFunction, n: i32) {
|
||||
debug_assert!(n <= 255, "Can't push more than 255 arguments into a closure");
|
||||
(LUA_SHARED.lua_pushcclosure)(*self, func, n)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub unsafe fn set_table(&self, index: i32) {
|
||||
(LUA_SHARED.lua_settable)(*self, index)
|
||||
|
|
Loading…
Reference in New Issue