From 46c9ebb855cf6bd9e70e5eeef0817ea65899bb6b Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sun, 6 Aug 2023 20:46:43 +0100 Subject: [PATCH] Derive default to make bilge 2.0 happy (and may as well) --- agb/src/display/mod.rs | 3 ++- agb/src/display/object/unmanaged/attributes.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/agb/src/display/mod.rs b/agb/src/display/mod.rs index 76d9e5a8..c61ef432 100644 --- a/agb/src/display/mod.rs +++ b/agb/src/display/mod.rs @@ -161,8 +161,9 @@ pub fn busy_wait_for_vblank() { } #[bitsize(2)] -#[derive(FromBits, PartialEq, Eq, Clone, Copy, Debug)] +#[derive(FromBits, PartialEq, Eq, Clone, Copy, Debug, Default)] pub enum Priority { + #[default] P0 = 0, P1 = 1, P2 = 2, diff --git a/agb/src/display/object/unmanaged/attributes.rs b/agb/src/display/object/unmanaged/attributes.rs index ef5f8b17..3437cf16 100644 --- a/agb/src/display/object/unmanaged/attributes.rs +++ b/agb/src/display/object/unmanaged/attributes.rs @@ -135,25 +135,28 @@ impl Attributes { } #[bitsize(2)] -#[derive(FromBits, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(FromBits, Clone, Copy, Debug, PartialEq, Eq, Default)] enum ObjectMode { Normal, Affine, + #[default] Disabled, AffineDouble, } #[bitsize(2)] -#[derive(TryFromBits, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(TryFromBits, Clone, Copy, Debug, PartialEq, Eq, Default)] enum GraphicsMode { + #[default] Normal, AlphaBlending, Window, } #[bitsize(1)] -#[derive(FromBits, Clone, Copy, Debug, PartialEq, Eq)] +#[derive(FromBits, Clone, Copy, Debug, PartialEq, Eq, Default)] enum ColourMode { + #[default] Four, Eight, }