diff --git a/.changes/accel-copy.md b/.changes/accel-copy.md new file mode 100644 index 0000000..20bb3d8 --- /dev/null +++ b/.changes/accel-copy.md @@ -0,0 +1,5 @@ +--- +"muda": "patch" +--- + +Derive `Copy` for `Accelerator` type. \ No newline at end of file diff --git a/src/accelerator.rs b/src/accelerator.rs index 4836de7..9572baf 100644 --- a/src/accelerator.rs +++ b/src/accelerator.rs @@ -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, diff --git a/src/platform_impl/windows/accelerator.rs b/src/platform_impl/windows/accelerator.rs index a8de9e9..41baa61 100644 --- a/src/platform_impl/windows/accelerator.rs +++ b/src/platform_impl/windows/accelerator.rs @@ -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), } }