Skip to content

Commit

Permalink
Ensure each variant of enum VMStatus and TrustLevel
Browse files Browse the repository at this point in the history
has a specific discriminant value

Signed-off-by: dmitry-erin <[email protected]>
  • Loading branch information
dmitry-erin committed Sep 4, 2024
1 parent 13e76f5 commit e431f56
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions common/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit e431f56

Please sign in to comment.