diff --git a/database/src/lib.rs b/database/src/lib.rs index 1a2acfe..3221562 100644 --- a/database/src/lib.rs +++ b/database/src/lib.rs @@ -67,9 +67,10 @@ impl FromStr for Query { return Err(failure::err_msg( "Search by Short Key ID is not supported, sorry!")); } - if let Ok(fp) = Fingerprint::from_str(term) { + let term_nospace = term.replace(" ", ""); + if let Ok(fp) = Fingerprint::from_str(&term_nospace) { Ok(ByFingerprint(fp)) - } else if let Ok(keyid) = KeyID::from_str(term) { + } else if let Ok(keyid) = KeyID::from_str(&term_nospace) { Ok(ByKeyID(keyid)) } else if let Ok(email) = Email::from_str(term) { Ok(ByEmail(email))