diff options
Diffstat (limited to 'src/lua.rs')
-rw-r--r-- | src/lua.rs | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -1,7 +1,6 @@ use std::fmt::Display; use std::path::Path; use std::str::from_utf8; -use std::sync::Arc; use rlua::Function; use rlua::HookTriggers; @@ -13,7 +12,6 @@ use crate::Context; use self::template::ArgIndex; -mod serde; pub mod template; pub enum ScriptError { @@ -49,18 +47,6 @@ pub fn lua_context<A>(run: impl FnOnce(rlua::Context) -> rlua::Result<A>) -> rlu .eval::<Table>() .expect("error in api.lua"); - api.set( - "decode_toml", - ctx.create_function(|_ctx, text: String| { - toml::from_str::<toml::Value>(&text) - .map_err(|e| rlua::Error::ExternalError(Arc::new(e))) - .and_then(|v| { - serde::to_value(_ctx, v) - .map_err(|e| rlua::Error::ExternalError(Arc::new(e))) - }) - })?, - )?; - ctx.globals().raw_set("gitpad", api).unwrap(); run(ctx) |