Skip to content

Commit

Permalink
feat: derive Copy for Accelerator
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Dec 12, 2022
1 parent e587421 commit e80c113
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/accel-copy.md
@@ -0,0 +1,5 @@
---
"muda": "patch"
---

Derive `Copy` for `Accelerator` type.
2 changes: 1 addition & 1 deletion src/accelerator.rs
Expand Up @@ -33,7 +33,7 @@ use std::{borrow::Borrow, hash::Hash, str::FromStr};
/// A keyboard shortcut that consists of an optional combination
/// of modifier keys (provided by [`Modifiers`](crate::accelerator::Modifiers)) and
/// one key ([`Code`](crate::accelerator::Code)).
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)]
pub struct Accelerator {
pub(crate) mods: Modifiers,
pub(crate) key: Code,
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/windows/accelerator.rs
Expand Up @@ -162,7 +162,7 @@ fn key_to_vk(key: &Code) -> VIRTUAL_KEY {
Code::MediaPlayPause => VK_MEDIA_PLAY_PAUSE,
Code::LaunchMail => VK_LAUNCH_MAIL,
Code::Convert => VK_CONVERT,
key => panic!("Unsupported modifier: {}", key),
key => panic!("Unsupported key: {}", key),
}
}

Expand Down

0 comments on commit e80c113

Please sign in to comment.