From 20981a7963a77fa1f9649f54de7789e578c13008 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Thu, 30 Mar 2023 18:02:46 +0200 Subject: [PATCH] Fixing clippy lint --- src/register.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/register.rs b/src/register.rs index 91b8ea9..d1bfef2 100644 --- a/src/register.rs +++ b/src/register.rs @@ -13,7 +13,7 @@ pub mod common { pub const PHY_CONFIG: u16 = 0x2E; pub const VERSION: u16 = 0x39; - #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] + #[derive(Default, Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] #[repr(u8)] pub enum PhyOperationMode { /// 10BT half-duplex. Auto-negotiation disabled. @@ -29,6 +29,7 @@ pub mod common { /// Power down mode. PowerDown = 0b110_000, /// All capable. Auto-negotiation enabled. + #[default] Auto = 0b111_000, } @@ -38,12 +39,6 @@ pub mod common { } } - impl Default for PhyOperationMode { - fn default() -> PhyOperationMode { - PhyOperationMode::Auto - } - } - #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] #[repr(u8)] pub enum PhySpeedStatus {