summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Matuszewski <igor@sequoia-pgp.org>2020-04-06 18:46:32 +0200
committerIgor Matuszewski <xanewok@gmail.com>2020-04-07 15:26:40 +0000
commit803c8b7bfad326711893aff39ddd15605f6e3e11 (patch)
tree1e7991d780057f5f50cd1656d3dcc316a6589aa6
parentb4d60cfba4600496197a68a4e4d24afa05562868 (diff)
openpgp: Simplify Key4::has_unencrypted_secret
-rw-r--r--openpgp/src/packet/key.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/openpgp/src/packet/key.rs b/openpgp/src/packet/key.rs
index e5ba3883..500e899e 100644
--- a/openpgp/src/packet/key.rs
+++ b/openpgp/src/packet/key.rs
@@ -1342,16 +1342,10 @@ impl<P, R> Key4<P, R>
/// Returns whether the key contains unencrypted secret key
/// material.
- pub fn has_unencrypted_secret(&self) -> bool
- {
- if let Some(secret) = &self.secret {
- if let SecretKeyMaterial::Unencrypted { .. } = secret {
- true
- } else {
- false
- }
- } else {
- false
+ pub fn has_unencrypted_secret(&self) -> bool {
+ match self.secret {
+ Some(SecretKeyMaterial::Unencrypted { .. }) => true,
+ _ => false,
}
}