refactor: remove some easy to remove unwrap() calls

This commit is contained in:
link2xt
2025-11-19 11:59:24 +00:00
committed by l
parent b4cd99fc56
commit 849cde9757
3 changed files with 7 additions and 6 deletions

View File

@@ -679,8 +679,9 @@ impl MimeMessage {
fn parse_system_message_headers(&mut self, context: &Context) {
if self.get_header(HeaderDef::AutocryptSetupMessage).is_some() && !self.incoming {
self.parts.retain(|part| {
part.mimetype.is_none()
|| part.mimetype.as_ref().unwrap().as_ref() == MIME_AC_SETUP_FILE
part.mimetype
.as_ref()
.is_none_or(|mimetype| mimetype.as_ref() == MIME_AC_SETUP_FILE)
});
if self.parts.len() == 1 {