Skip to content

Commit 6e81f36

Browse files
authored
fix: Localize loop varible for Lua 5.5 compatibility (#26)
1 parent 664c19e commit 6e81f36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/luarocks/build/rust-mlua.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ function mlua.run(rockspec, no_install)
102102
local luadir = path.lua_dir(rockspec.name, rockspec.version)
103103

104104
fs.make_dir(dir.dir_name(luadir))
105-
for from, to in pairs(rockspec.build.include) do
105+
for f, to in pairs(rockspec.build.include) do
106+
-- Make loop variable mutable in Lua 5.5
107+
local from = f
106108
if type(from) == "number" then
107109
from = to
108110
end

0 commit comments

Comments
 (0)