]> git.nega.tv - josh/narcissus/commitdiff
Add Hash impl for flags
authorJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 23:17:31 +0000 (00:17 +0100)
committerJoshua Simmons <josh@nega.tv>
Sat, 19 Nov 2022 23:17:31 +0000 (00:17 +0100)
narcissus-core/src/lib.rs

index 559580aa753e7cdee9210ac39547a4f6818e8c98..686378ef9567360dcfa5887dbeeeb4092f870454 100644 (file)
@@ -113,6 +113,7 @@ macro_rules! thread_token_def {
 #[macro_export]
 macro_rules! flags_def {
     ($name:ident) => {
+        #[derive(PartialEq, Hash, Debug)]
         pub struct $name(u32);
 
         impl $name {
@@ -156,12 +157,6 @@ macro_rules! flags_def {
             }
         }
 
-        impl PartialEq for $name {
-            fn eq(&self, rhs: &Self) -> bool {
-                self.0 == rhs.0
-            }
-        }
-
         impl Eq for $name {}
 
         impl std::ops::BitOr for $name {