Skip to content

Commit

Permalink
Implement Hash trait on DiskKind, MacAddr, Signal and on `Pro…
Browse files Browse the repository at this point in the history
…cessStatus`
  • Loading branch information
GuillaumeGomez committed Jan 15, 2025
1 parent ffe3d20 commit 73cc315
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl std::ops::DerefMut for Disks {
/// println!("{:?}: {:?}", disk.name(), disk.kind());
/// }
/// ```
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum DiskKind {
/// HDD type.
HDD,
Expand Down
2 changes: 1 addition & 1 deletion src/common/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl NetworkData {
/// MAC address for network interface.
///
/// It is returned by [`NetworkData::mac_address`][crate::NetworkData::mac_address].
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MacAddr(pub [u8; 6]);

impl MacAddr {
Expand Down
4 changes: 2 additions & 2 deletions src/common/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ pub struct LoadAvg {
///
/// If you want the list of the supported signals on the current system, use
/// [`SUPPORTED_SIGNALS`][crate::SUPPORTED_SIGNALS].
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Debug)]
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum Signal {
/// Hangup detected on controlling terminal or death of controlling process.
Hangup,
Expand Down Expand Up @@ -984,7 +984,7 @@ pub struct CGroupLimits {
}

/// Enum describing the different status of a process.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub enum ProcessStatus {
/// ## Linux
///
Expand Down

0 comments on commit 73cc315

Please sign in to comment.