From 4c01a8f92925d8657ddeef76f5bc8fa2815d08f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Mon, 31 May 2021 20:41:18 +0200 Subject: [PATCH] pounder: clippy --- ad9959/src/lib.rs | 1 + src/hardware/pounder/mod.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index 4a66349..cafe4fe 100644 --- a/ad9959/src/lib.rs +++ b/ad9959/src/lib.rs @@ -43,6 +43,7 @@ pub enum Mode { /// The configuration registers within the AD9959 DDS device. The values of each register are /// equivalent to the address. +#[allow(clippy::upper_case_acronyms)] pub enum Register { CSR = 0x00, FR1 = 0x01, diff --git a/src/hardware/pounder/mod.rs b/src/hardware/pounder/mod.rs index 3f4cd3d..3105632 100644 --- a/src/hardware/pounder/mod.rs +++ b/src/hardware/pounder/mod.rs @@ -24,7 +24,7 @@ pub enum GpioPin { Led7Red = 3, Led8Green = 4, Led9Red = 5, - AttLe0 = 8 + 0, + AttLe0 = 8, AttLe1 = 8 + 1, AttLe2 = 8 + 2, AttLe3 = 8 + 3, @@ -89,14 +89,14 @@ pub struct DdsClockConfig { pub external_clock: bool, } -impl Into for Channel { +impl From for ad9959::Channel { /// Translate pounder channels to DDS output channels. - fn into(self) -> ad9959::Channel { - match self { - Channel::In0 => ad9959::Channel::Two, - Channel::In1 => ad9959::Channel::Four, - Channel::Out0 => ad9959::Channel::One, - Channel::Out1 => ad9959::Channel::Three, + fn from(other: Channel) -> Self { + match other { + Channel::In0 => Self::Two, + Channel::In1 => Self::Four, + Channel::Out0 => Self::One, + Channel::Out1 => Self::Three, } } }