From 6f053d69116eab8947d092b325305bd3e5729f9b Mon Sep 17 00:00:00 2001 From: pierreyoda Date: Mon, 30 Oct 2023 17:52:42 +0100 Subject: [PATCH] :arrow_up: Upgrade dependencies --- Cargo.toml | 6 +++--- src/bin/input.rs | 25 +++++++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4220d58..cdd2b39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,11 +19,11 @@ default = [] tracing = [] [dependencies] -log = "0.4.17" -toml = "0.7.2" +log = "0.4.20" +toml = "0.8.6" [dependencies.clap] -version = "4.1.6" +version = "4.4.7" features = ["derive", "wrap_help"] [dependencies.sdl2] diff --git a/src/bin/input.rs b/src/bin/input.rs index 91b041d..6dbc382 100644 --- a/src/bin/input.rs +++ b/src/bin/input.rs @@ -223,13 +223,22 @@ mod test { let r = super::keyboard_hm_from_config(config, "*test*".into()); assert!(r.is_ok()); let keys_hm = r.unwrap(); - assert_eq!(*keys_hm.get("Up".into()).unwrap(), JoypadKey::Up); - assert_eq!(*keys_hm.get("Down".into()).unwrap(), JoypadKey::Down); - assert_eq!(*keys_hm.get("Left".into()).unwrap(), JoypadKey::Left); - assert_eq!(*keys_hm.get("Right".into()).unwrap(), JoypadKey::Right); - assert_eq!(*keys_hm.get("Numpad1".into()).unwrap(), JoypadKey::Select); - assert_eq!(*keys_hm.get("Numpad3".into()).unwrap(), JoypadKey::Start); - assert_eq!(*keys_hm.get("E".into()).unwrap(), JoypadKey::A); - assert_eq!(*keys_hm.get("T".into()).unwrap(), JoypadKey::B); + assert_eq!(keys_hm.get(&"Up".to_string()).unwrap(), &JoypadKey::Up); + assert_eq!(keys_hm.get(&"Down".to_string()).unwrap(), &JoypadKey::Down); + assert_eq!(keys_hm.get(&"Left".to_string()).unwrap(), &JoypadKey::Left); + assert_eq!( + keys_hm.get(&"Right".to_string()).unwrap(), + &JoypadKey::Right + ); + assert_eq!( + keys_hm.get(&"Numpad1".to_string()).unwrap(), + &JoypadKey::Select + ); + assert_eq!( + keys_hm.get(&"Numpad3".to_string()).unwrap(), + &JoypadKey::Start + ); + assert_eq!(keys_hm.get(&"E".to_string()).unwrap(), &JoypadKey::A); + assert_eq!(keys_hm.get(&"T".to_string()).unwrap(), &JoypadKey::B); } }