Skip to content

Commit

Permalink
Merge pull request GuillaumeGomez#1112 from jimmyruann/master
Browse files Browse the repository at this point in the history
Implement Display for DiskKind
  • Loading branch information
GuillaumeGomez authored Oct 24, 2023
2 parents 5b576c1 + f5acb92 commit 89f23d7
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 89f23d7

Please sign in to comment.