aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
authorTeddy Wing2018-09-24 11:20:03 +0200
committerTeddy Wing2018-09-24 11:20:03 +0200
commit882dfbe6f0aad091613839841d2f54334e37b32e (patch)
treeb1639e7fcd8cfb1cdb7c02069f82844f181255c1 /src/parser.rs
parent457b2796e6fc268074b87d36c9f9a2c25eb4b5af (diff)
downloaddome-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.rs2
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,