From a439397c6285584ebd27a816610f5bc0246c5edf Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Mon, 22 Nov 2021 15:36:30 +0100 Subject: [PATCH] Clippy fixes. --- openpgp-card-sequoia/src/sq_util.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/openpgp-card-sequoia/src/sq_util.rs b/openpgp-card-sequoia/src/sq_util.rs index 96c49a4..915635f 100644 --- a/openpgp-card-sequoia/src/sq_util.rs +++ b/openpgp-card-sequoia/src/sq_util.rs @@ -126,22 +126,20 @@ pub fn get_subkey_by_fingerprint<'a>( } Ok(Some(validkey)) - } else { - if keys.len() == 0 { - Ok(None) - } else if keys.len() == 2 { - Err(Error::InternalError(anyhow!( - "Found two results for {}, probably the cert has the \ + } else if keys.is_empty() { + Ok(None) + } else if keys.len() == 2 { + Err(Error::InternalError(anyhow!( + "Found two results for {}, probably the cert has the \ primary as a subkey?", - fp - ))) - } else { - Err(Error::InternalError(anyhow!( - "Found {} results for (sub)key {}, this is unexpected", - keys.len(), - fp - ))) - } + fp + ))) + } else { + Err(Error::InternalError(anyhow!( + "Found {} results for (sub)key {}, this is unexpected", + keys.len(), + fp + ))) } }