From 072c0061ee14ce2f57a7db0fd51733c7aa707358 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 25 Feb 2026 22:52:37 +0000 Subject: [PATCH] refactor: do not chain Autocrypt key verification to parsing .and_then() and Ok() are unnecessary here. --- src/aheader.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/aheader.rs b/src/aheader.rs index c8cde836c..b2f81fc39 100644 --- a/src/aheader.rs +++ b/src/aheader.rs @@ -108,13 +108,11 @@ impl FromStr for Aheader { .remove("keydata") .context("keydata attribute is not found") .and_then(|raw| { - SignedPublicKey::from_base64(&raw).context("autocrypt key cannot be decoded") - }) - .and_then(|key| { - key.verify_bindings() - .and(Ok(key)) - .context("Autocrypt key cannot be verified") + SignedPublicKey::from_base64(&raw).context("Autocrypt key cannot be decoded") })?; + public_key + .verify_bindings() + .context("Autocrypt key cannot be verified")?; let prefer_encrypt = attributes .remove("prefer-encrypt")