Skip to content

Commit

Permalink
deps: update mlua to 0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
replcat committed Oct 26, 2024
1 parent 39b84fe commit 6f7be8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ libuv = { workspace = true, optional = true }
luajit = { workspace = true }
macros = { workspace = true, features = ["plugin"] }
miniserde = { version = "0.1", optional = true }
mlua = { version = "0.9", features = ["luajit"], optional = true }
mlua = { version = "0.10", features = ["luajit"], optional = true }
thiserror = { workspace = true }
types = { workspace = true, features = ["serde"] }

[dev-dependencies]
mlua = { version = "0.9", features = ["luajit", "module"] }
mlua = { version = "0.10", features = ["luajit", "module"] }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.0", features = ["full"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/mlua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use nvim_oxi::{mlua::lua, print, Result};
fn mlua() -> Result<()> {
print!("Hello from nvim-oxi..");
let lua = lua();
let print = lua.globals().get::<_, LuaFunction>("print")?;
let print: LuaFunction = lua.globals().get("print")?;
print.call("..and goodbye from mlua!")?;
Ok(())
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ pub mod mlua {
/// Ok(())
/// }
/// ```
pub fn lua() -> &'static mlua::Lua {
pub fn lua() -> mlua::Lua {
unsafe {
luajit::with_state(|lua_state| {
mlua::Lua::init_from_ptr(lua_state as *mut _).into_static()
mlua::Lua::init_from_ptr(lua_state as *mut _)
})
}
}
Expand Down

0 comments on commit 6f7be8c

Please sign in to comment.