diff options
| author | Teddy Wing | 2018-09-24 11:20:03 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-09-24 11:20:03 +0200 | 
| commit | 882dfbe6f0aad091613839841d2f54334e37b32e (patch) | |
| tree | b1639e7fcd8cfb1cdb7c02069f82844f181255c1 /src/parser.rs | |
| parent | 457b2796e6fc268074b87d36c9f9a2c25eb4b5af (diff) | |
| download | dome-key-map-882dfbe6f0aad091613839841d2f54334e37b32e.tar.bz2 | |
run_key_action_for_mode(): Keep track of `in_mode` in `state`
Instead of letting the Objective-C code keep track of `in_mode` by
passing it around in `CKeyActionResult`, keep track of it in a `State`
struct.
Derive `Clone` on `HeadphoneButton` to resolve this error:
    error[E0277]: the trait bound `parser::HeadphoneButton: std::clone::Clone` is not satisfied
       --> src/cocoa_bridge.rs:273:38
        |
    273 |         state.in_mode = Some(trigger.to_vec());
        |                                      ^^^^^^ the trait `std::clone::Clone` is not implemented for `parser::HeadphoneButton`
Diffstat (limited to 'src/parser.rs')
| -rw-r--r-- | src/parser.rs | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/src/parser.rs b/src/parser.rs index 1d9aa56..ea96740 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -14,7 +14,7 @@ use combine::parser::repeat::take_until;  use combine::stream::state::{SourcePosition, State};  #[repr(C)] -#[derive(Debug, Hash, Eq, PartialEq)] +#[derive(Clone, Debug, Hash, Eq, PartialEq)]  pub enum HeadphoneButton {      Play,      Up, | 
