From 0c13d2e2715668d3c36ae8b90dc9588d8ab6b252 Mon Sep 17 00:00:00 2001
From: Georgy Moshkin <gmoshkin@picodata.io>
Date: Wed, 5 Oct 2022 18:14:46 +0300
Subject: [PATCH] refactor: tarantool::eval -> tarantool::exec

---
 src/main.rs      | 4 ++--
 src/tarantool.rs | 4 ++--
 src/traft/mod.rs | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index af5c7f5b3f..68119904bc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -283,7 +283,7 @@ fn picolib_setup(args: &args::Run) {
 }
 
 fn init_handlers() {
-    tarantool::eval(
+    tarantool::exec(
         r#"
         box.schema.user.grant('guest', 'super', nil, nil, {if_not_exists = true})
         "#,
@@ -1033,7 +1033,7 @@ fn test_one(t: &InnerTest) {
 
     tarantool::set_cfg(&cfg);
     traft::Storage::init_schema(traft::PeerStorage::new().unwrap());
-    tarantool::eval(
+    tarantool::exec(
         r#"
         box.schema.user.grant('guest', 'super', nil, nil, {if_not_exists = true})
         "#,
diff --git a/src/tarantool.rs b/src/tarantool.rs
index a16377451b..8295b45d5b 100644
--- a/src/tarantool.rs
+++ b/src/tarantool.rs
@@ -44,7 +44,7 @@ macro_rules! declare_cfunc {
         fn used(_: unsafe extern "C" fn(FunctionCtx, FunctionArgs) -> c_int) {}
 
         used($($func_name)+);
-        $crate::tarantool::eval(concat!(
+        $crate::tarantool::exec(concat!(
             "box.schema.func.create('.",
             $crate::stringify_last_token!($($func_name)+),
             "', {
@@ -163,7 +163,7 @@ pub fn set_cfg(cfg: &Cfg) {
 }
 
 #[track_caller]
-pub fn eval(code: &str) -> Result<(), LuaError> {
+pub fn exec(code: &str) -> Result<(), LuaError> {
     let l = lua_state();
     l.exec(code)
 }
diff --git a/src/traft/mod.rs b/src/traft/mod.rs
index 4b3f22616e..2fb0f117cd 100644
--- a/src/traft/mod.rs
+++ b/src/traft/mod.rs
@@ -271,7 +271,7 @@ pub struct OpEvalLua {
 impl OpResult for OpEvalLua {
     type Result = Result<(), LuaError>;
     fn result(&self) -> Self::Result {
-        crate::tarantool::eval(&self.code)
+        crate::tarantool::exec(&self.code)
     }
 }
 
-- 
GitLab