Skip to content

Commit 9e3f1f4

Browse files
committed
clippy
1 parent 0812adb commit 9e3f1f4

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

src/adc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ pub struct Adc<ADC> {
2828
clocks: Clocks,
2929
}
3030

31-
#[derive(Clone, Copy, Debug, PartialEq)]
32-
#[allow(non_camel_case_types)]
3331
/// ADC sampling time
3432
///
3533
/// Options for the sampling time, each is T + 0.5 ADC clock cycles.
34+
#[allow(non_camel_case_types)]
35+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3636
pub enum SampleTime {
3737
/// 1.5 cycles sampling time
3838
T_1,
@@ -75,7 +75,7 @@ impl From<SampleTime> for u8 {
7575
}
7676
}
7777

78-
#[derive(Clone, Copy, Debug, PartialEq)]
78+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7979
/// ADC data register alignment
8080
pub enum Align {
8181
/// Right alignment of output data
@@ -169,7 +169,7 @@ adc_pins!(pac::ADC3,
169169
);
170170

171171
/// Stored ADC config can be restored using the `Adc::restore_cfg` method
172-
#[derive(Copy, Clone, Debug, PartialEq, Default)]
172+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)]
173173
pub struct StoredConfig(SampleTime, Align);
174174

175175
macro_rules! adc_hal {

src/dma.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ pub enum Error {
1313
Overrun,
1414
}
1515

16+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1617
pub enum Event {
1718
HalfTransfer,
1819
TransferComplete,
1920
}
2021

21-
#[derive(Clone, Copy, PartialEq)]
22+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2223
pub enum Half {
2324
First,
2425
Second,

src/gpio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl Default for Dynamic {
312312

313313
impl Active for Dynamic {}
314314

315-
#[derive(Debug, PartialEq)]
315+
#[derive(Debug, PartialEq, Eq)]
316316
pub enum PinModeError {
317317
IncorrectMode,
318318
}

src/i2c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub enum DutyCycle {
4040
Ratio16to9,
4141
}
4242

43-
#[derive(Debug, PartialEq)]
43+
#[derive(Debug, PartialEq, Eq)]
4444
pub enum Mode {
4545
Standard {
4646
frequency: Hertz,

src/rcc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const HSI: u32 = 8_000_000; // Hz
107107
///
108108
/// **NOTE**: Currently, it is not guaranteed that the exact frequencies selected will be
109109
/// used, only frequencies close to it.
110-
#[derive(Debug, Default, PartialEq)]
110+
#[derive(Debug, Default, PartialEq, Eq)]
111111
pub struct CFGR {
112112
hse: Option<u32>,
113113
hclk: Option<u32>,
@@ -334,7 +334,7 @@ impl BKP {
334334
///
335335
/// let clocks = rcc.cfgr.freeze(&mut flash.acr);
336336
/// ```
337-
#[derive(Clone, Copy, Debug, PartialEq)]
337+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
338338
pub struct Clocks {
339339
hclk: Hertz,
340340
pclk1: Hertz,

src/time.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use cortex_m::peripheral::{DCB, DWT};
3535
use crate::rcc::Clocks;
3636

3737
/// Bits per second
38-
#[derive(Clone, Copy, PartialEq, PartialOrd, Debug)]
38+
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Debug)]
3939
pub struct Bps(pub u32);
4040

4141
pub use fugit::{
@@ -134,7 +134,6 @@ impl MonoTimer {
134134
dwt.enable_cycle_counter();
135135

136136
// now the CYCCNT counter can't be stopped or reset
137-
drop(dwt);
138137

139138
MonoTimer {
140139
frequency: clocks.hclk(),

src/timer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct Timer<TIM> {
8181
pub(crate) clk: Hertz,
8282
}
8383

84-
#[derive(Clone, Copy, PartialEq)]
84+
#[derive(Clone, Copy, PartialEq, Eq)]
8585
#[repr(u8)]
8686
pub enum Channel {
8787
C1 = 0,
@@ -91,7 +91,7 @@ pub enum Channel {
9191
}
9292

9393
/// Interrupt events
94-
#[derive(Clone, Copy, PartialEq)]
94+
#[derive(Clone, Copy, PartialEq, Eq)]
9595
pub enum SysEvent {
9696
/// [Timer] timed out / count down ended
9797
Update,
@@ -245,7 +245,7 @@ impl Timer<SYST> {
245245
}
246246
}
247247

248-
#[derive(Clone, Copy, Debug, PartialEq)]
248+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
249249
#[repr(u8)]
250250
pub enum Ocm {
251251
Frozen = 0,

0 commit comments

Comments
 (0)