From f395e6f05c5b301e2ecb0959af17944de0f5e662 Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Sun, 3 Mar 2024 13:06:20 +0100 Subject: [PATCH] feat(translator): implement serde feature (#181) Enables the serialization/deserialization of the rhai::AST and IndexMap. --- engine/translator/Cargo.toml | 3 ++- engine/translator/README.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/translator/Cargo.toml b/engine/translator/Cargo.toml index e050ca1..2c46643 100644 --- a/engine/translator/Cargo.toml +++ b/engine/translator/Cargo.toml @@ -17,10 +17,11 @@ default = ["rhai", "strsim"] rhai = ["dep:rhai"] rhai-wasm = ["rhai", "rhai/wasm-bindgen"] strsim = ["dep:strsim"] +serde = ["indexmap/serde", "rhai/serde"] [dependencies] rhai = { version = "1.17.0", optional = true, features = ["only_i32", "f32_float", "no_custom_syntax"] } -indexmap = { version = "2.2.2", features = ["serde"] } +indexmap = { version = "2.2.2" } strsim = { version = "0.10.0", optional = true } [dev-dependencies] diff --git a/engine/translator/README.md b/engine/translator/README.md index 979d684..23dedbd 100644 --- a/engine/translator/README.md +++ b/engine/translator/README.md @@ -5,3 +5,4 @@ Enhance the language processing tasks within in input method engine. - rhai: Enables the usage of the rhai scripting language. - rhai-wasm: Like rhai, but wasm compatible. - strsim: Enables the text similarity algorithm for better predictions. +- serde: Enables the serialization/deseroalization.