From de6f4b2a4da1f5fc9011c30485ab65159cdbd9cc Mon Sep 17 00:00:00 2001 From: Baud Date: Mon, 5 Feb 2024 21:13:53 +0000 Subject: [PATCH] chore: Derive default --- atem-connection-rs/src/enums/mod.rs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/atem-connection-rs/src/enums/mod.rs b/atem-connection-rs/src/enums/mod.rs index 8a2be2f..adcd96a 100644 --- a/atem-connection-rs/src/enums/mod.rs +++ b/atem-connection-rs/src/enums/mod.rs @@ -1,4 +1,6 @@ +#[derive(Default)] pub enum Model { + #[default] Unknown = 0x00, TVS = 0x01, OneME = 0x02, @@ -19,13 +21,9 @@ pub enum Model { MiniExtremeISO = 0x11, } -impl Default for Model { - fn default() -> Self { - Model::Unknown - } -} - +#[derive(Default)] pub enum ProtocolVersion { + #[default] Unknown = 0, V7_2 = 0x00020016, // 2.22 // TODO - verify this is correct V7_5_2 = 0x0002001b, // 2.27 // The naming of this may be off @@ -34,12 +32,6 @@ pub enum ProtocolVersion { V8_1_1 = 0x0002001e, // 2.30 } -impl Default for ProtocolVersion { - fn default() -> Self { - ProtocolVersion::Unknown - } -} - pub enum TransitionStyle { MIX = 0x00, DIP = 0x01, @@ -257,7 +249,9 @@ pub enum TransferMode { WriteAudio = 256, } +#[derive(Default)] pub enum VideoMode { + #[default] N525i5994NTSC = 0, P625i50PAL = 1, N525i5994169 = 2, @@ -293,12 +287,6 @@ pub enum VideoMode { N1080p60 = 27, } -impl Default for VideoMode { - fn default() -> Self { - VideoMode::N525i5994NTSC - } -} - pub enum TransferState { Queued, Locked,