diff options
author | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-29 15:22:26 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2021-09-30 08:31:20 +0300 |
commit | df6566889a3e439e866fd1940fc6ca303441a6d0 (patch) | |
tree | 345541c15a0785c53adcd2786e37592dd3a3463f /sq | |
parent | fb1cbb2c31537c6e24d70ce44a00a28e3281f37b (diff) |
Revert "Simplify tests for OK"
This reverts commit 666c5731e5c705bc85007625524bf93a41994ee9.
Diffstat (limited to 'sq')
-rw-r--r-- | sq/src/commands/decrypt.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sq/src/commands/decrypt.rs b/sq/src/commands/decrypt.rs index 0d874a3b..45e2b4e7 100644 --- a/sq/src/commands/decrypt.rs +++ b/sq/src/commands/decrypt.rs @@ -171,7 +171,8 @@ impl<'a> DecryptionHelper for Helper<'a> { self.key_hints.get(&keyid).unwrap())))?.into(); let algo = key.pk_algo(); - if key.secret_mut().decrypt_in_place(algo, &p).is_ok() { + if let Some(()) = + key.secret_mut().decrypt_in_place(algo, &p).ok() { break key.clone().into_keypair().unwrap() } else { eprintln!("Bad password."); @@ -229,7 +230,8 @@ impl<'a> DecryptionHelper for Helper<'a> { self.key_hints.get(&keyid).unwrap())))?.into(); let algo = key.pk_algo(); - if key.secret_mut().decrypt_in_place(algo, &p).is_ok() { + if let Some(()) = + key.secret_mut().decrypt_in_place(algo, &p).ok() { break key.clone().into_keypair().unwrap() } else { eprintln!("Bad password."); |