feat: Derive (de)serialize for Key (#213)

This commit is contained in:
Ridan Vandenbergh 2021-03-08 22:09:30 +01:00 committed by GitHub
parent 44cd304cdf
commit f1c6d2b59c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,6 +170,7 @@ impl Modifiers {
/// Many keys are omitted because they are not always physical keys (depending on keyboard language), e.g. `;` and `§`,
/// and are therefor unsuitable as keyboard shortcuts if you want your app to be portable.
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
#[cfg_attr(feature = "persistence", derive(serde::Deserialize, serde::Serialize))]
pub enum Key {
ArrowDown,
ArrowLeft,