diff options
| author | Teddy Wing | 2018-08-08 06:04:21 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-08-08 06:04:21 +0200 |
| commit | 8235c7d9f2d4aa5d423d34b388bb2ad5c5516de0 (patch) | |
| tree | ddd2f5c4536b6420fa8ac17fb30bfe34ae755b57 /src | |
| parent | 98f951add465f5c298cbf9179db3a3af36fe967d (diff) | |
| download | dome-key-map-8235c7d9f2d4aa5d423d34b388bb2ad5c5516de0.tar.bz2 | |
Make `Trigger` an enum instead of a `String`
`Trigger` can only be one of three values, so it should really be an
enum. But of course, the actual trigger is a set of these buttons, so we
want a list of trigger buttons as the map hash keys.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2,7 +2,11 @@ extern crate combine; use std::collections::HashMap; -type Trigger = String; +pub enum Trigger { + Play, + Up, + Down, +} type Action = String; pub enum MapKind { Map, @@ -15,8 +19,8 @@ pub struct Map { } pub struct DKMapGroup { - maps: HashMap<Trigger, Map>, - modes: HashMap<Trigger, HashMap<Trigger, Map>>, + maps: HashMap<Vec<Trigger>, Map>, + modes: HashMap<Vec<Trigger>, HashMap<Vec<Trigger>, Map>>, } #[cfg(test)] |
