mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-06 00:23:08 +02:00
Clean up linting warnings: this if
has identical blocks.
Commands: cargo clippy --tests --no-deps --workspace Warnings: warning: this `if` has identical blocks --> database/src/openpgp_utils.rs:89:27 | 89 | if !is_exportable { | ___________________________^ 90 | | false 91 | | } else if is_status_revoked(uid.revocation_status(&POLICY, None)) { | |_________^ | note: same as this --> database/src/openpgp_utils.rs:91:75 | 91 | } else if is_status_revoked(uid.revocation_status(&POLICY, None)) { | ___________________________________________________________________________^ 92 | | false 93 | | } else if let Ok(email) = Email::try_from(uid.userid()) { | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else = note: `#[warn(clippy::if_same_then_else)]` on by default
This commit is contained in:
@@ -86,9 +86,7 @@ pub fn tpk_clean(tpk: &Cert) -> Result<Cert> {
|
||||
pub fn tpk_filter_alive_emails(tpk: &Cert, emails: &[Email]) -> Cert {
|
||||
tpk.clone().retain_userids(|uid| {
|
||||
let is_exportable = uid.self_signatures().any(|s| s.exportable().is_ok());
|
||||
if !is_exportable {
|
||||
false
|
||||
} else if is_status_revoked(uid.revocation_status(&POLICY, None)) {
|
||||
if !is_exportable || is_status_revoked(uid.revocation_status(&POLICY, None)) {
|
||||
false
|
||||
} else if let Ok(email) = Email::try_from(uid.userid()) {
|
||||
emails.contains(&email)
|
||||
|
Reference in New Issue
Block a user