From 790512d52a01da18eb75e11ed01971f8f3c55e18 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 11 Jan 2023 23:19:07 +0000 Subject: [PATCH] Reduce code indentation --- src/imap.rs | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/imap.rs b/src/imap.rs index fe8e3a1fb..f8b75574f 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -2375,23 +2375,28 @@ async fn add_all_recipients_as_contacts( .map(|s| normalize_name(s)) .unwrap_or_default(); - match ContactAddress::new(&recipient.addr) { - Err(err) => warn!( - context, - "Could not add contact for recipient with address {:?}: {:#}", recipient.addr, err - ), - Ok(recipient_addr) => { - let (_, modified) = Contact::add_or_lookup( + let recipient_addr = match ContactAddress::new(&recipient.addr) { + Err(err) => { + warn!( context, - &display_name_normalized, - recipient_addr, - Origin::OutgoingTo, - ) - .await?; - if modified != Modifier::None { - any_modified = true; - } + "Could not add contact for recipient with address {:?}: {:#}", + recipient.addr, + err + ); + continue; } + Ok(recipient_addr) => recipient_addr, + }; + + let (_, modified) = Contact::add_or_lookup( + context, + &display_name_normalized, + recipient_addr, + Origin::OutgoingTo, + ) + .await?; + if modified != Modifier::None { + any_modified = true; } } if any_modified {