diff --git a/.github/workflows/cargo-release.yml b/.github/workflows/cargo-release.yml index 4563b9c..31baa94 100644 --- a/.github/workflows/cargo-release.yml +++ b/.github/workflows/cargo-release.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Lua/LuaJIT uses: xpol/setup-lua@v0.3 with: - lua-version: '5.1.5' + lua-version: '5.1' - name: Set Up Rust uses: actions-rs/toolchain@v1 # Set up the Rust toolchain @@ -33,7 +33,7 @@ jobs: run: cargo build - name: Test - run: lua.exe ltests/test.lua + run: lua5.1 ltests/test.lua - name: Install Cargo Release run: cargo install cargo-release # Install the cargo-release tool diff --git a/src/json_rpc.rs b/src/json_rpc.rs index 1b7c48e..90f6caa 100644 --- a/src/json_rpc.rs +++ b/src/json_rpc.rs @@ -1,7 +1,7 @@ use crate::app::AppData; use log::{debug, info}; -use mlua::prelude::{LuaFunction, LuaString}; -use mlua::{Error, IntoLuaMulti, LightUserData, Lua, LuaSerdeExt, Nil, Value}; +use mlua::prelude::LuaFunction; +use mlua::{Error, Lua, LuaSerdeExt, Value}; use serde::{Deserialize, Serialize}; use serde_json::Value::Null; use tokio::sync::oneshot; @@ -81,7 +81,7 @@ pub fn process_rpc( ) -> Result { let luav = lua.to_value(&request).map_err(ProcessRpcError::LuaError)?; - let mut lua_table = luav.as_table().unwrap(); + let lua_table = luav.as_table().unwrap(); // Remove the id field from the table sent to the Lua function. if let None = &request.id { diff --git a/src/lib.rs b/src/lib.rs index 99fc8f9..9dfc4c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,9 +49,9 @@ pub fn lua_json_rpc(lua: &Lua) -> Result { mlua::Error::RuntimeError(format!("Error creating server: {:?}", e)) })?; - lua.create_function(move |lua: &Lua, ()| { + lua.create_function(move |_lua: &Lua, ()| { info!("Shutting Down Server"); - handle.stop(false); + drop(handle.stop(false)); Ok(()) }) })?,