Skip to content

Commit 8d2ca00

Browse files
Merge #126
126: Derive Eq for the SPI enums r=japaric a=jonas-schievink This allows matching against these in downstream crates, and seems like a logical addition to the existing PartialEq (since this doesn't contain any floats, obviously). Co-authored-by: Jonas Schievink <[email protected]>
2 parents dd92c3a + 188f44c commit 8d2ca00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/spi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub trait FullDuplex<Word> {
2727
}
2828

2929
/// Clock polarity
30-
#[derive(Clone, Copy, PartialEq)]
30+
#[derive(Clone, Copy, PartialEq, Eq)]
3131
pub enum Polarity {
3232
/// Clock signal low when idle
3333
IdleLow,
@@ -36,7 +36,7 @@ pub enum Polarity {
3636
}
3737

3838
/// Clock phase
39-
#[derive(Clone, Copy, PartialEq)]
39+
#[derive(Clone, Copy, PartialEq, Eq)]
4040
pub enum Phase {
4141
/// Data in "captured" on the first clock transition
4242
CaptureOnFirstTransition,
@@ -45,7 +45,7 @@ pub enum Phase {
4545
}
4646

4747
/// SPI mode
48-
#[derive(Clone, Copy, PartialEq)]
48+
#[derive(Clone, Copy, PartialEq, Eq)]
4949
pub struct Mode {
5050
/// Clock polarity
5151
pub polarity: Polarity,

0 commit comments

Comments
 (0)