Skip to content

Commit

Permalink
feat(preprocessor): implement the serde feature (#179)
Browse files Browse the repository at this point in the history
Now, we are able to serialize/deserialize the command enum.
  • Loading branch information
pythonbrad authored Mar 3, 2024
1 parent 5dc9261 commit b196dd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine/preprocessor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ authors = ["Brady Fomegne <[email protected]>"]
[features]
default = []
inhibit = []
serde = ["dep:serde", "keyboard-types/serde"]

[dependencies]
keyboard-types = "0.7.0"
keyboard-types = { version = "0.7.0", default-features = false }
afrim-memory = { version = "0.3.2", path = "../../memory" }
serde = { version = "1.0.197", features = ["derive"], optional = true }

[dev-dependencies]
keyboard-types = { version = "0.7.0", features = ["webdriver"] }
1 change: 1 addition & 0 deletions engine/preprocessor/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/// Possible commands that can be generated by the `afrim-preprocessor`.
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Command {
/// Request to commit a text.
CommitText(String),
Expand Down

0 comments on commit b196dd4

Please sign in to comment.