Implement Push for Ref
This commit is contained in:
parent
173149f2f7
commit
c39106b790
@ -1613,6 +1613,13 @@ impl_push_str!(BString);
|
||||
impl_push_str!(&str);
|
||||
impl_push_str!(String);
|
||||
|
||||
impl Push for Ref {
|
||||
fn push(&self, stack: &mut Stack) {
|
||||
stack.ensure(1);
|
||||
unsafe { lua_rawgeti(stack.as_ptr(), LUA_REGISTRYINDEX, self.key) }
|
||||
}
|
||||
}
|
||||
|
||||
/// [`Push`]es a copy of the value at an index onto a [`Stack`].
|
||||
///
|
||||
/// Equivalent to [`lua_pushvalue`].
|
||||
|
Loading…
x
Reference in New Issue
Block a user