Skip to content

Commit

Permalink
Implement Display for DiskKind
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyruann committed Oct 24, 2023
1 parent 911d230 commit f5acb92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5acb92

Please sign in to comment.