Repository: GuillaumeGomez/sysinfo (language: rust)

Issue:
Derive `Hash` for types like `MacAddr`
Derive `Hash` for types like `MacAddr`.


Discussion / hints:

Fix patch:
diff --git a/src/common/disk.rs b/src/common/disk.rs
index 83996da85..fee3dbaea 100644
--- a/src/common/disk.rs
+++ b/src/common/disk.rs
@@ -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,
diff --git a/src/common/network.rs b/src/common/network.rs
index 5a9e672a9..cf3930bc2 100644
--- a/src/common/network.rs
+++ b/src/common/network.rs
@@ -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 {
diff --git a/src/common/system.rs b/src/common/system.rs
index e5772bcfb..f09095b9e 100644
--- a/src/common/system.rs
+++ b/src/common/system.rs
@@ -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,
@@ -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
     ///


Test patch: