diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-02-26 23:21:54 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-02-26 23:21:54 +0100 |
commit | c146dba46d83726d7498b0c933afec79de89ff53 (patch) | |
tree | 40d82b31cf39d3c4aefdfb3d84a9ca7050344a99 | |
parent | 86309e9c4971bd2e4ba80bf4a655aab091cd89b9 (diff) |
openpgp: Remove unnecessary use of .mark_role_primary{,_ref}().
-rw-r--r-- | openpgp/src/cert/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/serialize/cert.rs | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs index 23033ff9..80f2311f 100644 --- a/openpgp/src/cert/mod.rs +++ b/openpgp/src/cert/mod.rs @@ -342,7 +342,7 @@ use super::*; /// /// // Primary key and related signatures. /// let c = cert.primary_key(); -/// acc.push(c.key().clone().mark_role_primary().into()); +/// acc.push(c.key().clone().into()); /// for s in c.self_signatures() { acc.push(s.clone().into()) } /// for s in c.certifications() { acc.push(s.clone().into()) } /// for s in c.self_revocations() { acc.push(s.clone().into()) } diff --git a/openpgp/src/serialize/cert.rs b/openpgp/src/serialize/cert.rs index 1cb606dd..689fcfcf 100644 --- a/openpgp/src/serialize/cert.rs +++ b/openpgp/src/serialize/cert.rs @@ -39,7 +39,7 @@ impl Cert { -> Result<()> { let primary = self.primary_key(); - PacketRef::PublicKey(primary.key().mark_role_primary_ref()) + PacketRef::PublicKey(primary.key()) .serialize(o)?; // Writes a signature if it is exportable or `! export`. @@ -174,8 +174,7 @@ impl SerializeInto for Cert { fn serialized_len(&self) -> usize { let mut l = 0; let primary = self.primary_key(); - l += PacketRef::PublicKey(primary.key().mark_role_primary_ref()) - .serialized_len(); + l += PacketRef::PublicKey(primary.key()).serialized_len(); for s in primary.self_revocations() { l += PacketRef::Signature(s).serialized_len(); @@ -404,7 +403,7 @@ impl<'a> TSK<'a> { }; let primary = self.cert.primary_key(); - serialize_key(o, primary.key().mark_role_primary_ref().into(), + serialize_key(o, primary.key().into(), Tag::PublicKey, Tag::SecretKey)?; for s in primary.self_signatures() { @@ -559,7 +558,7 @@ impl<'a> SerializeInto for TSK<'a> { }; let primary = self.cert.primary_key(); - l += serialized_len_key(primary.key().mark_role_primary_ref().into(), + l += serialized_len_key(primary.key().into(), Tag::PublicKey, Tag::SecretKey); for s in primary.self_signatures() { |