From cd2831bf876266c9200f6effe48bcc722cffe9ff Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Thu, 12 Jun 2025 17:52:29 +0100 Subject: [PATCH 1/2] chore: updated dependencies --- CHANGELOG.md | 2 ++ Cargo.toml | 14 +++++++------- src/preprocessor.rs | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00baf41..3aa2236 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- (lib) Updated dependencies. [(#33)](https://github.com/pythonbrad/afrim-js/pull/33) + ## [0.4.0] - 2024-05-04 ### Changed diff --git a/Cargo.toml b/Cargo.toml index 14d7197..7323d58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "afrim" -version = "0.4.0" +version = "0.4.1" authors = ["Brady Fomegne "] edition = "2018" description = "Afrim engine for javascript." @@ -17,15 +17,15 @@ strsim = ["afrim-translator/strsim"] rhai = ["afrim-translator/rhai-wasm"] [dependencies] -wasm-bindgen = "0.2.92" -afrim-preprocessor = { version = "0.6.1", default-features = false, features = ["serde"], git = "https://github.com/pythonbrad/afrim", rev = "5f40469" } +wasm-bindgen = "0.2.100" +afrim-preprocessor = { version = "0.6.2", default-features = false, features = ["serde"], git = "https://github.com/pythonbrad/afrim", rev = "448c9a4" } serde-wasm-bindgen = "0.6.5" -afrim-translator = { version = "0.2.1", default-features = false, features = ["serde"], git = "https://github.com/pythonbrad/afrim", rev = "5f40469" } -indexmap = { version = "2.2.6", features = ["serde"] } -toml = "0.8.12" +afrim-translator = { version = "0.2.2", default-features = false, features = ["serde"], git = "https://github.com/pythonbrad/afrim", rev = "448c9a4" } +indexmap = { version = "2.9.0", features = ["serde"] } +toml = "0.8.23" [dev-dependencies] -wasm-bindgen-test = "0.3.42" +wasm-bindgen-test = "0.3.50" [profile.release] lto = "fat" # turn on Link-Time Optimizations diff --git a/src/preprocessor.rs b/src/preprocessor.rs index af61110..8f3f925 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -135,7 +135,7 @@ pub mod utils { pub fn deserialize_event(key: &str, state: &str) -> Result { let event = KeyboardEvent { key: Key::from_str(key) - .map_err(|err| format!("[preprocessor] Unrecognized key.\nCaused by:\n\t{err}."))?, + .map_err(|err| format!("[preprocessor] Unrecognized key.\nCaused by:\n\t{err:?}."))?, state: match state { "keydown" => KeyState::Down, "keyup" => KeyState::Up, @@ -154,12 +154,12 @@ mod test { #[test] fn test_deserialize_event() { - use afrim_preprocessor::{Key, KeyState, KeyboardEvent}; + use afrim_preprocessor::{Key, KeyState, KeyboardEvent, NamedKey}; assert_eq!( utils::deserialize_event("Alt", "keydown").unwrap(), KeyboardEvent { - key: Key::Alt, + key: Key::Named(NamedKey::Alt), state: KeyState::Down, ..Default::default() } From c094f7ef77691715f21246b71f4a9203b5915b2a Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Thu, 12 Jun 2025 17:56:16 +0100 Subject: [PATCH 2/2] fix fmt --- src/preprocessor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/preprocessor.rs b/src/preprocessor.rs index 8f3f925..c5e162d 100644 --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -134,8 +134,9 @@ pub mod utils { /// Convert an JsKeyboardEvent to KeyboardEvent. pub fn deserialize_event(key: &str, state: &str) -> Result { let event = KeyboardEvent { - key: Key::from_str(key) - .map_err(|err| format!("[preprocessor] Unrecognized key.\nCaused by:\n\t{err:?}."))?, + key: Key::from_str(key).map_err(|err| { + format!("[preprocessor] Unrecognized key.\nCaused by:\n\t{err:?}.") + })?, state: match state { "keydown" => KeyState::Down, "keyup" => KeyState::Up,