From 89b973b815906f4fe0feaba013b69eebe82d58b5 Mon Sep 17 00:00:00 2001 From: Felix Wittwer Date: Sat, 6 Aug 2022 16:32:19 +0200 Subject: [PATCH] Impl Default for Color --- src/color.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/color.rs b/src/color.rs index 3859d1d..7a06ecc 100644 --- a/src/color.rs +++ b/src/color.rs @@ -1,7 +1,11 @@ +use core::default::Default; + + /// Represents the state of a pixel in the display -#[derive(Clone, Copy, PartialEq, Debug)] +#[derive(Clone, Copy, Debug, Default, PartialEq)] pub enum Color { Black, + #[default] White, Red, } @@ -37,7 +41,7 @@ impl From for Color { match value.into_inner() { 0 => Color::Black, _ => Color::White, - } + } } }