add ShortcutListener::has

This commit is contained in:
Robin Appelman 2023-06-17 20:44:04 +02:00
commit 7f555ba931

View file

@ -81,7 +81,11 @@ impl ShortcutListener {
} }
/// Returns `true` if the shortcut was previously listened to /// Returns `true` if the shortcut was previously listened to
pub fn remove(&self, shortcut: Shortcut) -> bool { pub fn remove(&self, shortcut: &Shortcut) -> bool {
self.shortcuts.lock().unwrap().remove(&shortcut) self.shortcuts.lock().unwrap().remove(shortcut)
}
pub fn has(&self, shortcut: &Shortcut) -> bool {
self.shortcuts.lock().unwrap().contains(shortcut)
} }
} }