From 269ef9c55d9272780144ceae5c0e8e20a7701d53 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Tue, 27 Apr 2021 10:11:37 +0100 Subject: [PATCH] Fix lua51 scope compilation --- src/scope.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index 70d6116..98dc173 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -185,16 +185,16 @@ impl<'lua, 'scope> Scope<'lua, 'scope> { #[cfg(any(feature = "lua51", feature = "luajit"))] let newtable = self.lua.create_table()?; - let destructor: DestructorCallback = Box::new(move |u| { - let state = u.lua.state; + let destructor: DestructorCallback = Box::new(move |ud| { + let state = ud.lua.state; assert_stack(state, 2); - u.lua.push_ref(&u); + ud.lua.push_ref(&ud); // Clear uservalue #[cfg(any(feature = "lua54", feature = "lua53", feature = "lua52"))] ffi::lua_pushnil(state); #[cfg(any(feature = "lua51", feature = "luajit"))] - u.lua.push_ref(&newtable.0); + ud.lua.push_ref(&newtable.0); ffi::lua_setuservalue(state, -2); // We know the destructor has not run yet because we hold a reference to the @@ -419,7 +419,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> { #[cfg(any(feature = "lua54", feature = "lua53", feature = "lua52"))] ffi::lua_pushnil(state); #[cfg(any(feature = "lua51", feature = "luajit"))] - u.lua.push_ref(&newtable.0); + ud.lua.push_ref(&newtable.0); ffi::lua_setuservalue(state, -2); vec![Box::new(take_userdata::>(state))]