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: