aboutsummaryrefslogtreecommitdiff
path: root/src/lua.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-10-28 12:26:59 +0200
committerMartin Fischer <martin@push-f.com>2022-10-28 12:29:07 +0200
commit3433e3dda8917fe02b3b225d5e2829d0ec64946e (patch)
treeea5cb9bbcd475baf3d350c616857a09d56518a11 /src/lua.rs
parentd050c761c0940397b5808934937a8d5e13e670d4 (diff)
drop gitpad.decode_toml Lua function
The function made sense when we had Lua shebangs but now that they have been removed, the function doesn't make much sense anymore.
Diffstat (limited to 'src/lua.rs')
-rw-r--r--src/lua.rs14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/lua.rs b/src/lua.rs
index d8d82b2..70f63c5 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -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)