From 20cba4756a3c4fba9000b1e296d58da8aab40d65 Mon Sep 17 00:00:00 2001 From: Zefanja Jobse Date: Sat, 30 Sep 2023 14:58:20 +0200 Subject: [PATCH] replace &string with &str --- src/actions.rs | 2 +- src/send_keys.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions.rs b/src/actions.rs index dfff178..4748269 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -169,7 +169,7 @@ pub fn send_message( let game_info = is_running(game_name); if game_info.is_running { let mut message_id = current_message_id.load(atomic::Ordering::Relaxed); - let current_message: &String = &cfg.messages[message_id as usize]; + let current_message: &str = &cfg.messages[message_id as usize]; unsafe { SetForegroundWindow(game_info.game_process); diff --git a/src/send_keys.rs b/src/send_keys.rs index 9b1d0fc..a7d4320 100644 --- a/src/send_keys.rs +++ b/src/send_keys.rs @@ -51,7 +51,7 @@ pub unsafe fn key_enter(key_code: u16, timeout: u64) { key_up(key_code); } -pub unsafe fn send_key(key: &String, timeout: u64) { +pub unsafe fn send_key(key: &str, timeout: u64) { let char = key.chars().next().unwrap(); if let Some(dx) = char_to_dxcodes(char) { match dx {