fmt, clippy
This commit is contained in:
+5
-7
@@ -46,9 +46,7 @@ pub fn find_signing_key_for_email(
|
||||
pub fn validate_key_id(keyid: &str) -> Result<(), Box<dyn Error>> {
|
||||
let len = keyid.len();
|
||||
if len <= 8 {
|
||||
return Err(
|
||||
"short OpenPGP key IDs are broken; use a key fingerprint instead".into(),
|
||||
);
|
||||
return Err("short OpenPGP key IDs are broken; use a key fingerprint instead".into());
|
||||
} else if len <= 16 {
|
||||
log::warn!(
|
||||
"long OpenPGP key IDs are strongly discouraged; \
|
||||
@@ -65,10 +63,10 @@ pub fn validate_key_id(keyid: &str) -> Result<(), Box<dyn Error>> {
|
||||
fn find_secret_key(ctx: &mut Context, keyid: &str) -> Result<Option<gpgme::Key>, Box<dyn Error>> {
|
||||
for key_result in ctx.secret_keys()? {
|
||||
let key = key_result?;
|
||||
if let Ok(fingerprint) = key.fingerprint() {
|
||||
if fingerprint.ends_with(keyid) {
|
||||
return Ok(Some(key));
|
||||
}
|
||||
if let Ok(fingerprint) = key.fingerprint()
|
||||
&& fingerprint.ends_with(keyid)
|
||||
{
|
||||
return Ok(Some(key));
|
||||
}
|
||||
}
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user