summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-07-05 14:55:52 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-07-05 15:11:45 +0200
commit2d9e3d760e5ad3acc04ad81b6d467059115eb162 (patch)
treeff6ad699485c4aee37dbfbb100bf0e30c171198a
parent749bb03e750e5225def1cfe582632a9b4f34c8e1 (diff)
openpgp: Fix PartialEq for SubpacketArea.
- Do not compare the cache.
-rw-r--r--openpgp/src/packet/signature/subpacket.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/openpgp/src/packet/signature/subpacket.rs b/openpgp/src/packet/signature/subpacket.rs
index 5734e340..49d39abf 100644
--- a/openpgp/src/packet/signature/subpacket.rs
+++ b/openpgp/src/packet/signature/subpacket.rs
@@ -309,7 +309,7 @@ impl<'a> fmt::Debug for SubpacketRaw<'a> {
}
/// Subpacket area.
-#[derive(Clone, PartialEq, Eq)]
+#[derive(Clone, Eq)]
pub struct SubpacketArea {
/// Raw, unparsed subpacket data.
pub data: Vec<u8>,
@@ -325,6 +325,12 @@ pub struct SubpacketArea {
parsed: RefCell<Option<HashMap<SubpacketTag, (bool, u16, u16)>>>,
}
+impl PartialEq for SubpacketArea {
+ fn eq(&self, other: &SubpacketArea) -> bool {
+ self.data == other.data
+ }
+}
+
impl Hash for SubpacketArea {
fn hash<H: Hasher>(&self, state: &mut H) {
// We hash only the data, the cache is a hashmap and does not