From 24bd53f850bb5f07b1eee36fe3ac75082d439c10 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 23 Apr 2023 22:34:34 +0200 Subject: [PATCH] layout: derive Default for CustomEvent --- src/layout.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/layout.rs b/src/layout.rs index 88886be..fb1707c 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -152,9 +152,10 @@ impl Event { } /// Event from custom action. -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Default)] pub enum CustomEvent { /// No custom action. + #[default] NoEvent, /// The given custom action key is pressed. Press(&'static T), @@ -175,11 +176,6 @@ impl CustomEvent { } } } -impl Default for CustomEvent { - fn default() -> Self { - CustomEvent::NoEvent - } -} #[derive(Debug, Eq, PartialEq)] enum State {