Skip to content

Commit

Permalink
Simplify HashMap usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed Mar 12, 2024
1 parent c28dab1 commit f86c5a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions leptos_hotkeys/src/hotkeys_provider.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use leptos::html::ElementDescriptor;
use leptos::*;
#[cfg_attr(feature = "ssr", allow(unused_imports))]
use std::collections::HashMap;
use std::collections::HashSet;

#[cfg(not(feature = "ssr"))]
Expand All @@ -11,7 +9,7 @@ use wasm_bindgen::JsCast;
#[derive(Clone, Copy)]
pub struct HotkeysContext {
#[cfg(not(feature = "ssr"))]
pub(crate) pressed_keys: RwSignal<HashMap<String, web_sys::KeyboardEvent>>,
pub(crate) pressed_keys: RwSignal<std::collections::HashMap<String, web_sys::KeyboardEvent>>,

#[cfg(not(feature = "ssr"))]
pub active_ref_target: RwSignal<Option<web_sys::EventTarget>>,
Expand Down
4 changes: 1 addition & 3 deletions leptos_hotkeys/src/use_hotkeys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ use crate::types::Hotkey;

use leptos::{html::ElementDescriptor, *};

use std::collections::HashMap;

#[cfg_attr(feature = "ssr", allow(dead_code))]
fn is_hotkey_match(
hotkey: &Hotkey,
pressed_keyset: &mut HashMap<String, web_sys::KeyboardEvent>,
pressed_keyset: &mut std::collections::HashMap<String, web_sys::KeyboardEvent>,
) -> bool {
let mut modifiers_match = true;

Expand Down

0 comments on commit f86c5a1

Please sign in to comment.