diff options
Diffstat (limited to 'openpgp/examples/decrypt-with.rs')
-rw-r--r-- | openpgp/examples/decrypt-with.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index 09f44794..3a5723bc 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -89,8 +89,9 @@ impl DecryptionHelper for Helper { // Try each PKESK until we succeed. for pkesk in pkesks { if let Some(pair) = self.keys.get_mut(pkesk.recipient()) { - if let Ok(_) = pkesk.decrypt(pair, sym_algo) - .and_then(|(algo, session_key)| decrypt(algo, &session_key)) + if let Some(_) = pkesk.decrypt(pair, sym_algo) + .and_then(|(algo, session_key)| decrypt(algo, &session_key) + .ok()) { break; } |