From f374e1bc395840530f70543d30769518c3bab48b Mon Sep 17 00:00:00 2001 From: dmitry-erin Date: Wed, 4 Sep 2024 11:40:31 +0300 Subject: [PATCH] Ensure each variant of enum VMStatus and TrustLevel has a specific discriminant value Signed-off-by: dmitry-erin --- common/src/query.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/src/query.rs b/common/src/query.rs index eda0e8a..875d026 100644 --- a/common/src/query.rs +++ b/common/src/query.rs @@ -10,19 +10,21 @@ use serde::Serialize; use strum::{Display, EnumString}; #[derive(Clone, Copy, Debug, Default, Serialize, EnumString, Display)] +#[repr(u8)] pub enum VMStatus { #[default] - Running, - PoweredOff, - Paused, + Running = 0, + PoweredOff = 1, + Paused = 2, } #[derive(Clone, Copy, Debug, Default, Serialize, EnumString, Display)] +#[repr(u8)] pub enum TrustLevel { - Secure, + Secure = 0, #[default] - Warning, - NotSecure, + Warning = 1, + NotSecure = 2, } #[derive(Debug, Clone, Serialize)]