summaryrefslogtreecommitdiff
path: root/src/conversion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversion.rs')
-rw-r--r--src/conversion.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/conversion.rs b/src/conversion.rs
index cb68364..d50c645 100644
--- a/src/conversion.rs
+++ b/src/conversion.rs
@@ -33,6 +33,18 @@ impl<'lua> IntoLua<'lua> for Value<'lua> {
}
}
+impl<'lua> IntoLua<'lua> for &Value<'lua> {
+ #[inline]
+ fn into_lua(self, _: &'lua Lua) -> Result<Value<'lua>> {
+ Ok(self.clone())
+ }
+
+ #[inline]
+ unsafe fn push_into_stack(self, lua: &'lua Lua) -> Result<()> {
+ lua.push_value_ref(self)
+ }
+}
+
impl<'lua> FromLua<'lua> for Value<'lua> {
#[inline]
fn from_lua(lua_value: Value<'lua>, _: &'lua Lua) -> Result<Self> {