From f5acb92cbaf459d2155ed930acca488d05c0db2b Mon Sep 17 00:00:00 2001 From: Jimmy Ruan <12026187+jimmyruann@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:48:43 +0000 Subject: [PATCH] Implement Display for DiskKind --- src/common.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common.rs b/src/common.rs index e65cc54c3..d6710be05 100644 --- a/src/common.rs +++ b/src/common.rs @@ -2173,6 +2173,16 @@ pub enum DiskKind { Unknown(isize), } +impl fmt::Display for DiskKind { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(match *self { + DiskKind::HDD => "HDD", + DiskKind::SSD => "SSD", + _ => "Unknown", + }) + } +} + /// Interacting with users. /// /// ```no_run