Skip to content

Commit

Permalink
layout: derive Default for CustomEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure authored and TeXitoi committed Jun 6, 2023
1 parent 448db60 commit 24bd53f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ impl Event {
}

/// Event from custom action.
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Default)]
pub enum CustomEvent<T: 'static> {
/// No custom action.
#[default]
NoEvent,
/// The given custom action key is pressed.
Press(&'static T),
Expand All @@ -175,11 +176,6 @@ impl<T> CustomEvent<T> {
}
}
}
impl<T> Default for CustomEvent<T> {
fn default() -> Self {
CustomEvent::NoEvent
}
}

#[derive(Debug, Eq, PartialEq)]
enum State<T: 'static, K: 'static + Copy> {
Expand Down

0 comments on commit 24bd53f

Please sign in to comment.