11 lines
245 B
Rust
Raw Normal View History

2024-09-16 18:54:04 -07:00
pub enum Error{
Lua(mlua::Error),
}
2024-09-16 19:01:16 -07:00
pub fn run(source:String,context:&mut crate::context::Context)->Result<(),Error>{
let lua=mlua::Lua::new();
lua.sandbox(true).map_err(Error::Lua)?;
lua.load(source).exec().map_err(Error::Lua)?;
Ok(())
2024-09-16 18:54:04 -07:00
}