From accd17ff1a1c114a158ab7697cda8ecd70fde585 Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Sat, 17 Feb 2024 14:18:13 +0100 Subject: [PATCH] feat(translator): implement serde feature 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.