From 5e4408659797730cc311a0deb30e7ca936ec64b7 Mon Sep 17 00:00:00 2001 From: James Waples Date: Mon, 6 Dec 2021 18:48:45 +0000 Subject: [PATCH] Fix new version Clippy lints Closes #199 --- src/adc.rs | 7 +------ src/dma.rs | 12 +----------- src/rtc.rs | 12 +----------- 3 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/adc.rs b/src/adc.rs index 1f8dd2c..4df73af 100755 --- a/src/adc.rs +++ b/src/adc.rs @@ -332,16 +332,11 @@ pub struct Active { /// A collection of channels /// /// Used to set up multi-channel conversions. +#[derive(Default)] pub struct Channels { flags: u32, } -impl Default for Channels { - fn default() -> Self { - Channels { flags: 0 } - } -} - impl Channels { pub fn new() -> Channels { Default::default() diff --git a/src/dma.rs b/src/dma.rs index 0dc5b0f..2bc48d0 100644 --- a/src/dma.rs +++ b/src/dma.rs @@ -660,19 +660,9 @@ impl SupportedWordSize for u32 { } } -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Default)] pub struct Interrupts { pub transfer_error: bool, pub half_transfer: bool, pub transfer_complete: bool, } - -impl Default for Interrupts { - fn default() -> Self { - Self { - transfer_error: false, - half_transfer: false, - transfer_complete: false, - } - } -} diff --git a/src/rtc.rs b/src/rtc.rs index 81411f8..3a986b5 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -370,6 +370,7 @@ impl Rtc { } /// Flags to enable/disable RTC interrupts. +#[derive(Default)] pub struct Interrupts { pub timestamp: bool, pub wakeup_timer: bool, @@ -377,17 +378,6 @@ pub struct Interrupts { pub alarm_b: bool, } -impl Default for Interrupts { - fn default() -> Self { - Self { - timestamp: false, - wakeup_timer: false, - alarm_a: false, - alarm_b: false, - } - } -} - /// The RTC wakeup timer /// /// This timer can be used in two ways: