summaryrefslogtreecommitdiffstats
path: root/autocrypt
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-02-26 22:59:49 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-02-26 23:09:19 +0100
commit86309e9c4971bd2e4ba80bf4a655aab091cd89b9 (patch)
tree6898365f04b99c48fb6af97b25df427fa1d1978d /autocrypt
parentceab08e222fadc68c3330dbfe2b47db34bf7141f (diff)
openpgp: Don't unnecessarily use ComponentAmalgamation::bundle.
- A `ComponentAmalgamation` derefs to a `ComponentBundle`. Don't use `ComponentAmalgamation::bundle` if it is unnecessary and doesn't improve legibility.
Diffstat (limited to 'autocrypt')
-rw-r--r--autocrypt/src/lib.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/autocrypt/src/lib.rs b/autocrypt/src/lib.rs
index d8e9d119..e2b8ef55 100644
--- a/autocrypt/src/lib.rs
+++ b/autocrypt/src/lib.rs
@@ -111,8 +111,9 @@ impl AutocryptHeader {
let mut acc = Vec::new();
// The primary key and the most recent selfsig.
- acc.push(cert.primary_key().key().clone().into());
- cert.primary_key().bundle().self_signatures().iter().take(1)
+ let primary = cert.primary_key();
+ acc.push(primary.key().clone().into());
+ primary.self_signatures().iter().take(1)
.for_each(|s| acc.push(s.clone().into()));
// The subkeys and the most recent selfsig.
@@ -1101,9 +1102,9 @@ In the light of the Efail vulnerability I am asking myself if it's
.expect("Failed to parse key material.");
assert_eq!(&cert.fingerprint().to_string(),
"3E88 77C8 7727 4692 9751 89F5 D03F 6F86 5226 FE8B");
- assert_eq!(cert.userids().bundles().len(), 1);
+ assert_eq!(cert.userids().len(), 1);
assert_eq!(cert.keys().subkeys().count(), 1);
- assert_eq!(cert.userids().bundles().next().unwrap().userid().value(),
+ assert_eq!(cert.userids().next().unwrap().userid().value(),
&b"Testy McTestface <testy@example.org>"[..]);
}
}