From 2bd83f5229a0bb8bd019cf5d52b9dc3e4b287cb8 Mon Sep 17 00:00:00 2001
From: Boris Stepanenko <Boris.Stepanenko@gmail.com>
Date: Fri, 24 Jun 2022 14:20:27 +0300
Subject: [PATCH] net_box.lua: fix "used variable with unused hint"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since 0.26.0 luacheck emits a warning on the `_box` variable.
From luacheck v.0.26.0 release notes:

"Function arguments that start with a single underscore
get an "unused hint". Leaving them unused doesn't result
in a warning. Using them, on the other hand, is a
new warning (â„– 214)."

Renamed `_box` to `__box`, which isn't considered unused.

Closes #7304.

NO_DOC=testing
NO_TEST=testing
NO_CHANGELOG=testing
---
 src/box/lua/net_box.lua | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index c16fe5fc33..5092956df6 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -1180,8 +1180,8 @@ this_module.self = {
     timeout = function(self) return self end,
     wait_connected = function(self) return true end,
     is_connected = function(self) return true end,
-    call = function(_box, proc_name, args)
-        check_remote_arg(_box, 'call')
+    call = function(__box, proc_name, args)
+        check_remote_arg(__box, 'call')
         check_call_args(args)
         args = args or {}
         proc_name = tostring(proc_name)
@@ -1197,8 +1197,8 @@ this_module.self = {
             return handle_eval_result(pcall(proc, unpack(args)))
         end
     end,
-    eval = function(_box, expr, args)
-        check_remote_arg(_box, 'eval')
+    eval = function(__box, expr, args)
+        check_remote_arg(__box, 'eval')
         check_eval_args(args)
         args = args or {}
         local proc, errmsg = loadstring(expr)
-- 
GitLab