From 455c80e4977bd55b0534ffbceb89c4634c0a61c2 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 31 Mar 2020 14:30:16 +0200 Subject: openpgp: Clarify PartialEq for bit field types. --- openpgp/src/types/features.rs | 5 +++++ openpgp/src/types/key_flags.rs | 5 +++++ openpgp/src/types/server_preferences.rs | 5 +++++ 3 files changed, 15 insertions(+) (limited to 'openpgp/src/types') diff --git a/openpgp/src/types/features.rs b/openpgp/src/types/features.rs index b4b4a022..6bbaf995 100644 --- a/openpgp/src/types/features.rs +++ b/openpgp/src/types/features.rs @@ -2,6 +2,11 @@ use std::fmt; use std::hash::{Hash, Hasher}; /// Describes features supported by an OpenPGP implementation. +/// +/// # A note on equality +/// +/// `PartialEq` is implements semantic equality, i.e. it ignores +/// padding. #[derive(Clone)] pub struct Features{ mdc: bool, diff --git a/openpgp/src/types/key_flags.rs b/openpgp/src/types/key_flags.rs index 9109abe9..c5e905cb 100644 --- a/openpgp/src/types/key_flags.rs +++ b/openpgp/src/types/key_flags.rs @@ -5,6 +5,11 @@ use std::ops::{BitAnd, BitOr}; /// Describes how a key may be used, and stores additional /// information. +/// +/// # A note on equality +/// +/// `PartialEq` is implements semantic equality, i.e. it ignores +/// padding. #[derive(Clone)] pub struct KeyFlags{ for_certification: bool, diff --git a/openpgp/src/types/server_preferences.rs b/openpgp/src/types/server_preferences.rs index bc9d9cda..6600f348 100644 --- a/openpgp/src/types/server_preferences.rs +++ b/openpgp/src/types/server_preferences.rs @@ -2,6 +2,11 @@ use std::hash::{Hash, Hasher}; use std::fmt; /// Describes preferences regarding key servers. +/// +/// # A note on equality +/// +/// `PartialEq` is implements semantic equality, i.e. it ignores +/// padding. #[derive(Clone)] pub struct KeyServerPreferences{ no_modify: bool, -- cgit v1.2.3