diff --git a/src/layout.rs b/src/layout.rs index 8aedba7..2165d60 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -335,7 +335,17 @@ struct SequenceState { delay: u32, /// Keycode of a key that should be released at the next tick tapped: Option, +} +impl Default for SequenceState { + fn default() -> Self { + Self { + cur_event: None, + remaining_events: &[], + delay: 0, + tapped: None, + } + } } /// An event, waiting in a stack to be processed. @@ -619,10 +629,8 @@ impl { self.active_sequences.push_back(SequenceState { - cur_event: None, - delay: 0, - tapped: None, remaining_events: events, + ..Default::default() }); } &Layer(value) => {