summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-07-28 16:48:21 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-07-28 17:02:21 +0200
commitb9f1dac59c758826c7c92541d01f447179a1e4d2 (patch)
treea9c9f465e6433715edb749c21c0a6ae6f0197877 /openpgp/src/serialize.rs
parentc5f44ce753f3b56338311b9dc9d1d3de86307fa3 (diff)
openpgp: Reimplement the KeyFlags struct using Bitfield.
- This also drops the implementation of PartialOrd since we did not use it in the key selection after all. - Fixes #525.
Diffstat (limited to 'openpgp/src/serialize.rs')
-rw-r--r--openpgp/src/serialize.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs
index e243e906..a0a7e459 100644
--- a/openpgp/src/serialize.rs
+++ b/openpgp/src/serialize.rs
@@ -1396,7 +1396,7 @@ impl Marshal for SubpacketValue {
PolicyURI(ref p) =>
o.write_all(p)?,
KeyFlags(ref f) =>
- o.write_all(&f.to_vec())?,
+ o.write_all(f.as_slice())?,
SignersUserID(ref uid) =>
o.write_all(uid)?,
ReasonForRevocation { ref code, ref reason } => {
@@ -1459,7 +1459,7 @@ impl MarshalInto for SubpacketValue {
PreferredKeyServer(ref p) => p.len(),
PrimaryUserID(_) => 1,
PolicyURI(ref p) => p.len(),
- KeyFlags(ref f) => f.to_vec().len(),
+ KeyFlags(ref f) => f.as_slice().len(),
SignersUserID(ref uid) => uid.len(),
ReasonForRevocation { ref reason, .. } => 1 + reason.len(),
Features(ref f) => f.as_slice().len(),