Clippy fixes.

This commit is contained in:
Heiko Schaefer 2021-11-22 15:36:30 +01:00
parent 7413b5c062
commit a439397c62
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -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
)))
}
}