From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <l.wagner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 91FD28BD1B
 for <pbs-devel@lists.proxmox.com>; Thu, 27 Oct 2022 14:28:20 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 7BD11374F4
 for <pbs-devel@lists.proxmox.com>; Thu, 27 Oct 2022 14:28:20 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pbs-devel@lists.proxmox.com>; Thu, 27 Oct 2022 14:28:19 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 0323344C40
 for <pbs-devel@lists.proxmox.com>; Thu, 27 Oct 2022 14:28:19 +0200 (CEST)
From: Lukas Wagner <l.wagner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Thu, 27 Oct 2022 14:28:05 +0200
Message-Id: <20221027122806.79851-2-l.wagner@proxmox.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20221027122806.79851-1-l.wagner@proxmox.com>
References: <20221027122806.79851-1-l.wagner@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [lib.rs, acl.rs, mod.rs]
Subject: [pbs-devel] [PATCH pxar 1/1] derive PartialEq trait for Metadata
 and related structs
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Thu, 27 Oct 2022 12:28:20 -0000

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@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