diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-07 17:52:18 +0200 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2021-04-09 13:13:59 +0200 |
commit | baecfecbf953aa9e40f16084b927f35b69efc8f0 (patch) | |
tree | bac7c53d32187d6eff22d231dd556b4ada40d50f /openpgp/src/keyhandle.rs | |
parent | 4d7ecc72b384a9c30e7024eb2ebfaede9882db06 (diff) |
Lint: Use matches! macro.
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Diffstat (limited to 'openpgp/src/keyhandle.rs')
-rw-r--r-- | openpgp/src/keyhandle.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/openpgp/src/keyhandle.rs b/openpgp/src/keyhandle.rs index 607cb60f..e1afb93b 100644 --- a/openpgp/src/keyhandle.rs +++ b/openpgp/src/keyhandle.rs @@ -333,11 +333,9 @@ impl KeyHandle { /// # Ok(()) } /// ``` pub fn is_invalid(&self) -> bool { - match self { - KeyHandle::Fingerprint(Fingerprint::Invalid(_)) => true, - KeyHandle::KeyID(KeyID::Invalid(_)) => true, - _ => false, - } + matches!(self, + KeyHandle::Fingerprint(Fingerprint::Invalid(_)) + | KeyHandle::KeyID(KeyID::Invalid(_))) } /// Converts this `KeyHandle` to its canonical hexadecimal |