aboutsummaryrefslogtreecommitdiff
path: root/src/lua/serde/mod.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/serde/mod.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/serde/mod.rs')
-rw-r--r--src/lua/serde/mod.rs57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/lua/serde/mod.rs b/src/lua/serde/mod.rs
deleted file mode 100644
index 82a928a..0000000
--- a/src/lua/serde/mod.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-// vendored from https://github.com/zrkn/rlua_serde because it dependend on an outdated rlua version
-// Copyright (c) 2018 zrkn <zrkn@email.su>, licensed under the MIT License
-
-//! This crate allows you to serialize and deserialize any type that implements
-//! `serde::Serialize` and `serde::Deserialize` into/from `rlua::Value`.
-//!
-//! Implementation is similar to `serde_json::Value`
-//!
-//! Example usage:
-//!
-//! ```rust
-//! extern crate serde;
-//! #[macro_use]
-//! extern crate serde_derive;
-//! extern crate rlua;
-//! extern crate rlua_serde;
-//!
-//! fn main() {
-//! #[derive(Serialize, Deserialize)]
-//! struct Foo {
-//! bar: u32,
-//! baz: Vec<String>,
-//! }
-//!
-//! let lua = rlua::Lua::new();
-//! lua.context(|lua| {
-//! let foo = Foo {
-//! bar: 42,
-//! baz: vec![String::from("fizz"), String::from("buzz")],
-//! };
-//!
-//! let value = rlua_serde::to_value(lua, &foo).unwrap();
-//! lua.globals().set("value", value).unwrap();
-//! lua.load(
-//! r#"
-//! assert(value["bar"] == 42)
-//! assert(value["baz"][2] == "buzz")
-//! "#).exec().unwrap();
-//! });
-//! }
-//! ```
-
-pub mod de;
-pub mod error;
-pub mod ser;
-
-use rlua::{Context, Error, Value};
-
-pub fn to_value<T: serde::Serialize>(lua: Context, t: T) -> Result<Value, Error> {
- let serializer = ser::Serializer { lua };
- Ok(t.serialize(serializer)?)
-}
-
-pub fn from_value<'de, T: serde::Deserialize<'de>>(value: Value<'de>) -> Result<T, Error> {
- let deserializer = de::Deserializer { value };
- Ok(T::deserialize(deserializer)?)
-}