diff --git a/notmuch-more/src/parse/body.rs b/notmuch-more/src/parse/body.rs index 03f47e8..96122c6 100644 --- a/notmuch-more/src/parse/body.rs +++ b/notmuch-more/src/parse/body.rs @@ -31,6 +31,7 @@ pub(crate) fn parse_body_part(part: &mailparse::ParsedMail) -> Result match part.ctype.mimetype.as_str() { @@ -78,7 +79,8 @@ pub(crate) fn parse_body_part(part: &mailparse::ParsedMail) -> Result { - let mut first = parse_body_part(&part.subparts[0])?; + let mut first = + parse_body_part(part.subparts.first().ok_or(err_multipart_no_subpart)?)?; first.alternatives = part.subparts[1..] .iter() .map(parse_body_part) @@ -87,7 +89,8 @@ pub(crate) fn parse_body_part(part: &mailparse::ParsedMail) -> Result { - let mut first = parse_body_part(&part.subparts[0])?; + let mut first = + parse_body_part(part.subparts.first().ok_or(err_multipart_no_subpart)?)?; first.extra = part.subparts[1..] .iter() .map(parse_body_part) @@ -97,7 +100,8 @@ pub(crate) fn parse_body_part(part: &mailparse::ParsedMail) -> Result { - let mut first = parse_body_part(&part.subparts[0])?; + let mut first = + parse_body_part(part.subparts.first().ok_or(err_multipart_no_subpart)?)?; first.signature = Some(Box::new(parse_body_part( part.subparts[1..] .iter()