hack-ink / AiR

AI with Rust.
GNU General Public License v3.0
131 stars 6 forks source link

Fix hotkey selector panic #110

Closed Barafu closed 3 months ago

Barafu commented 3 months ago

Fixes application panic when trying to set a global hotkey to an unsupported hotkey. Instead of paic, saves hotkey as "Not set", which also allows disabling hotkeys when not needed.

AurevoirXavier commented 3 months ago

Thanks for your PR!

Personally, I aim to push performance to the limit. I suggest changing ToString to str since the allocation is unnecessary (every matching pattern is a literal static str), and the hotkeys are actually a pretty limited set, making a HashMap somewhat overkill.

Please fix the CI, and I'll merge it into the dev branch. After that, I'll make some improvements later.

Barafu commented 3 months ago

I'll change to &str, and replace HashMap with Vec<tuple>,

Barafu commented 3 months ago

Sorry, with those orange workflows I am not sure if I did everything I needed to do or not.