tool: Derive Eq, PartialEq on enums

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-10-05 10:15:07 -06:00
committed by Jeremy Soller
parent 4fa389e1bd
commit 166e03972b
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ use crate::{
SpiTarget, SpiTarget,
}; };
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(u8)] #[repr(u8)]
enum Cmd { enum Cmd {
// None = 0, // None = 0,
@ -46,7 +46,7 @@ const CMD_SPI_FLAG_DISABLE: u8 = 1 << 1;
const CMD_SPI_FLAG_SCRATCH: u8 = 1 << 2; const CMD_SPI_FLAG_SCRATCH: u8 = 1 << 2;
const CMD_SPI_FLAG_BACKUP: u8 = 1 << 3; const CMD_SPI_FLAG_BACKUP: u8 = 1 << 3;
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(u8)] #[repr(u8)]
pub enum SecurityState { pub enum SecurityState {
// Default value, flashing is prevented, cannot be set with security_set // Default value, flashing is prevented, cannot be set with security_set

View File

@ -21,7 +21,7 @@ pub trait Spi {
} }
/// Target which will receive SPI commands /// Target which will receive SPI commands
#[derive(Clone, Copy)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum SpiTarget { pub enum SpiTarget {
/// The ROM normally used by the EC /// The ROM normally used by the EC
Main, Main,