[pbs-devel] [PATCH pxar 1/1] derive PartialEq trait for Metadata and related structs

Lukas Wagner l.wagner at proxmox.com
Thu Oct 27 14:28:05 CEST 2022


This change is needed in order to compare a file's metadata
in the coming proxmox-backup-debug diff tool.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/format/acl.rs | 4 ++--
 src/format/mod.rs | 8 ++++----
 src/lib.rs        | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/format/acl.rs b/src/format/acl.rs
index 510e0bc..640f7e6 100644
--- a/src/format/acl.rs
+++ b/src/format/acl.rs
@@ -96,8 +96,8 @@ pub struct GroupObject {
     pub permissions: Permissions,
 }
 
-#[derive(Clone, Debug, Endian)]
-#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
+#[derive(Clone, Debug, Endian, PartialEq)]
+#[cfg_attr(feature = "test-harness", derive(Eq))]
 #[repr(C)]
 pub struct Default {
     pub user_obj_permissions: Permissions,
diff --git a/src/format/mod.rs b/src/format/mod.rs
index 3224a49..742e126 100644
--- a/src/format/mod.rs
+++ b/src/format/mod.rs
@@ -371,8 +371,8 @@ impl From<Stat_V1> for Stat {
     }
 }
 
-#[derive(Clone, Debug, Default, Endian)]
-#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
+#[derive(Clone, Debug, Default, Endian, PartialEq)]
+#[cfg_attr(feature = "test-harness", derive(Eq))]
 #[repr(C)]
 pub struct Stat {
     pub mode: u64,
@@ -679,8 +679,8 @@ fn test_linux_devices() {
     assert_eq!(dev.to_dev_t(), c_dev);
 }
 
-#[derive(Clone, Debug)]
-#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
+#[derive(Clone, Debug, PartialEq)]
+#[cfg_attr(feature = "test-harness", derive(Eq))]
 #[repr(C)]
 pub struct FCaps {
     pub data: Vec<u8>,
diff --git a/src/lib.rs b/src/lib.rs
index c22b8da..03f5df5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,8 +29,8 @@ pub use format::{mode, Stat};
 ///
 /// This includes the usual data you'd get from `stat()` as well as ACLs, extended attributes, file
 /// capabilities and more.
-#[derive(Clone, Debug, Default)]
-#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
+#[derive(Clone, Debug, Default, PartialEq)]
+#[cfg_attr(feature = "test-harness", derive(Eq))]
 pub struct Metadata {
     /// Data typically found in a `stat()` call.
     pub stat: Stat,
@@ -305,8 +305,8 @@ impl MetadataBuilder {
 /// ACL entries of a pxar archive.
 ///
 /// This contains all the various ACL entry types supported by the pxar archive format.
-#[derive(Clone, Debug, Default)]
-#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
+#[derive(Clone, Debug, Default, PartialEq)]
+#[cfg_attr(feature = "test-harness", derive(Eq))]
 pub struct Acl {
     /// User ACL list.
     pub users: Vec<format::acl::User>,
-- 
2.30.2






More information about the pbs-devel mailing list