summaryrefslogtreecommitdiff
path: root/src/userdata.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2019-11-04 16:31:19 +0000
committerAlex Orlenko <zxteam@protonmail.com>2019-11-04 22:23:15 +0000
commitae677b0918179c98ecd747d6fd74f3d3883fc0bc (patch)
tree9ae6ee98c2ec42228c3664d4192a7a1f0ac94186 /src/userdata.rs
parent6874c2e004f9fa92add76f1ddb4076bf80fd90ad (diff)
downloadmlua-ae677b0918179c98ecd747d6fd74f3d3883fc0bc.zip
Move lua 5.1 support under new "lua51" feature
Diffstat (limited to 'src/userdata.rs')
-rw-r--r--src/userdata.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/userdata.rs b/src/userdata.rs
index bc6b62e..15c200e 100644
--- a/src/userdata.rs
+++ b/src/userdata.rs
@@ -333,7 +333,7 @@ impl<'lua> AnyUserData<'lua> {
/// [`get_user_value`]: #method.get_user_value
pub fn set_user_value<V: ToLua<'lua>>(&self, v: V) -> Result<()> {
let lua = self.0.lua;
- #[cfg(not(feature = "lua53"))]
+ #[cfg(any(feature = "lua51", feature = "luajit"))]
let v = {
// Lua 5.1 allows to store only table. Then we will wrap the value.
let t = lua.create_table()?;
@@ -364,7 +364,7 @@ impl<'lua> AnyUserData<'lua> {
ffi::lua_getuservalue(lua.state, -1);
lua.pop_value()
};
- #[cfg(not(feature = "lua53"))]
+ #[cfg(any(feature = "lua51", feature = "luajit"))]
return crate::Table::from_lua(res, lua)?.get(1);
#[cfg(feature = "lua53")]
V::from_lua(res, lua)