From bddaf3af81b836ac8d25199f154fc59a95848dab Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 9 Jun 2022 12:16:54 -0400 Subject: planet: Implement Display for Health --- src/planet.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/planet.rs b/src/planet.rs index b2aa221..210de5a 100644 --- a/src/planet.rs +++ b/src/planet.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, sync::Arc}; +use std::{convert::TryFrom, sync::Arc, fmt::Display}; use virt::{domain::{Domain, DomainState}}; use serde::{Serialize, Deserialize}; @@ -169,6 +169,12 @@ pub enum Health { GuestSuspended = 7 } +impl Display for Health { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } +} + impl TryFrom for Health { type Error = Error; fn try_from(value: u32) -> Result { -- cgit v1.2.3