From 40d8addac73f76421acd40fbbb4ed1d2851250da Mon Sep 17 00:00:00 2001 From: Rajas Paranjpe <52586855+ChocolateLoverRaj@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:14:28 -0800 Subject: [PATCH] derive FromRepr for FpMode Useful for getting an FpMode from the output of the fp mode command --- crosec/src/commands/fp_mode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crosec/src/commands/fp_mode.rs b/crosec/src/commands/fp_mode.rs index a0c1a5c..e1b8565 100644 --- a/crosec/src/commands/fp_mode.rs +++ b/crosec/src/commands/fp_mode.rs @@ -2,14 +2,14 @@ use std::os::fd::AsRawFd; use bytemuck::{Pod, Zeroable}; use strum::IntoEnumIterator; -use strum_macros::{EnumIter, EnumString, IntoStaticStr}; +use strum_macros::{EnumIter, EnumString, FromRepr, IntoStaticStr}; use crate::{ec_command::ec_command_bytemuck, EcCmdResult}; use super::CrosEcCmd; /// Note that with the ChromiumOS ectool, to start enrolling, as well as continue the next step in enrolling, you do `ectool --name=cros_fp fpmode enroll`. The equivalent of this is to do `ectool fp-mode EnrollImage EnrollSession`. -#[derive(EnumString, EnumIter, IntoStaticStr, Clone, Copy, Debug)] +#[derive(EnumString, EnumIter, IntoStaticStr, Clone, Copy, Debug, FromRepr)] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[repr(u32)] pub enum FpMode {