diff options
| author | Teddy Wing | 2018-09-29 01:04:53 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-09-29 01:04:53 +0200 |
| commit | 16cd3895f7b111544927d71904aab912d9abbf59 (patch) | |
| tree | 7232dae8de98221eb549d4b33a01eaad27fa01d2 /dome_key_map.h | |
| parent | 829f257d4c0064209102083dc9d692834e42a8c1 (diff) | |
| download | dome-key-map-16cd3895f7b111544927d71904aab912d9abbf59.tar.bz2 | |
Try to propagate KeyCodeConvertible from Action to everywhere
Such a pain. As soon as I clear one set of compilation errors, another
set crops up. The last one was like the following:
error[E0277]: the trait bound `K: std::default::Default` is not satisfied
--> src/cocoa_bridge.rs:117:1
|
117 | / pub extern "C" fn state_new<K>() -> *mut State<K>
118 | | where K: KeyCodeConvertible {
119 | | Box::into_raw(Box::new(State::default()))
120 | | }
| |_^ the trait `std::default::Default` is not implemented for `K`
|
= help: consider adding a `where K: std::default::Default` bound
note: required by `cocoa_bridge::State`
--> src/cocoa_bridge.rs:100:1
|
100 | / pub struct State<K: KeyCodeConvertible>
101 | | where K: Default {
102 | | in_mode: Option<Vec<HeadphoneButton>>,
103 | | map_group: Option<MapGroup<K>>,
104 | | }
| |_^
error[E0277]: the trait bound `K: std::default::Default` is not satisfied
I'm done with this. Just going to make a darn enum of 'autopilot's
`Character` and `KeyCode` structs so I don't have to deal with this
mess.
Diffstat (limited to 'dome_key_map.h')
| -rw-r--r-- | dome_key_map.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/dome_key_map.h b/dome_key_map.h index dd61a38..b8c4b79 100644 --- a/dome_key_map.h +++ b/dome_key_map.h @@ -23,7 +23,7 @@ typedef enum { MapKind_Command, } MapKind; -typedef struct State State; +typedef struct State_K State_K; typedef struct { const HeadphoneButton *buttons; @@ -36,12 +36,12 @@ typedef struct { const Trigger *in_mode; } CKeyActionResult; -const CKeyActionResult *c_run_key_action(State *state, Trigger trigger, const Trigger *mode); +const CKeyActionResult *c_run_key_action(State_K *state, Trigger trigger, const Trigger *mode); void logger_init(void); -void state_free(State *ptr); +void state_free(State_K *ptr); -void state_load_map_group(State *ptr); +void state_load_map_group(State_K *ptr); -State *state_new(void); +State_K *state_new(void); |
