summaryrefslogtreecommitdiffstats
path: root/openpgp/examples
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-01-10 13:47:51 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-01-10 13:56:13 +0100
commitcb001fdaec7e6fa91109f7649ab170e534ec7227 (patch)
treee2d433561c58a99e77a258efba41a432e6aee893 /openpgp/examples
parent6a0321845194931740fe7376f115f897d86a0084 (diff)
openpgp: Prefer consuming MessageStructure's to referencing them.
Diffstat (limited to 'openpgp/examples')
-rw-r--r--openpgp/examples/generate-sign-verify.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/examples/generate-sign-verify.rs b/openpgp/examples/generate-sign-verify.rs
index fa75ed6d..65202609 100644
--- a/openpgp/examples/generate-sign-verify.rs
+++ b/openpgp/examples/generate-sign-verify.rs
@@ -99,15 +99,15 @@ impl<'a> VerificationHelper for Helper<'a> {
// policy.
let mut good = false;
- for (i, layer) in structure.iter().enumerate() {
+ for (i, layer) in structure.into_iter().enumerate() {
match (i, layer) {
// First, we are interested in signatures over the
// data, i.e. level 0 signatures.
- (0, MessageLayer::SignatureGroup { ref results }) => {
+ (0, MessageLayer::SignatureGroup { results }) => {
// Finally, given a VerificationResult, which only says
// whether the signature checks out mathematically, we apply
// our policy.
- match results.get(0) {
+ match results.into_iter().next() {
Some(VerificationResult::GoodChecksum { .. }) =>
good = true,
Some(VerificationResult::NotAlive { .. }) =>