From e2f8f462a125048c5335fa754b6800a0154af4e2 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Thu, 5 Oct 2023 10:15:07 -0600 Subject: [PATCH] tool: Derive Eq, PartialEq on enums Signed-off-by: Tim Crawford --- tool/src/ec.rs | 4 ++-- tool/src/spi.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tool/src/ec.rs b/tool/src/ec.rs index 868971737..0bd793784 100644 --- a/tool/src/ec.rs +++ b/tool/src/ec.rs @@ -14,7 +14,7 @@ use crate::{ SpiTarget, }; -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(u8)] enum Cmd { // 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_BACKUP: u8 = 1 << 3; -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(u8)] pub enum SecurityState { // Default value, flashing is prevented, cannot be set with security_set diff --git a/tool/src/spi.rs b/tool/src/spi.rs index b3d8cf343..abb6fe858 100644 --- a/tool/src/spi.rs +++ b/tool/src/spi.rs @@ -21,7 +21,7 @@ pub trait Spi { } /// Target which will receive SPI commands -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum SpiTarget { /// The ROM normally used by the EC Main,