diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-07-25 10:59:48 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-07-25 10:59:48 +0200 |
commit | 17fba10d8ffe14bb47ae6389dbb28b012eac1b35 (patch) | |
tree | e9bb16c769d926985b7e1259626a284dce84d865 /src/mail/mod.rs | |
parent | 24fed41288531bf3bf69657eaf3287ff545d0254 (diff) | |
download | aerogramme-17fba10d8ffe14bb47ae6389dbb28b012eac1b35.tar.gz aerogramme-17fba10d8ffe14bb47ae6389dbb28b012eac1b35.zip |
replacing mail_parser by eml_codec, first iteration
Diffstat (limited to 'src/mail/mod.rs')
-rw-r--r-- | src/mail/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mail/mod.rs b/src/mail/mod.rs index 80c348a..bbe4033 100644 --- a/src/mail/mod.rs +++ b/src/mail/mod.rs @@ -13,7 +13,7 @@ pub mod user; #[allow(clippy::upper_case_acronyms)] pub struct IMF<'a> { raw: &'a [u8], - parsed: mail_parser::Message<'a>, + parsed: eml_codec::part::composite::Message<'a>, } impl<'a> TryFrom<&'a [u8]> for IMF<'a> { @@ -23,7 +23,7 @@ impl<'a> TryFrom<&'a [u8]> for IMF<'a> { eprintln!("---- BEGIN PARSED MESSAGE ----"); let _ = std::io::stderr().write_all(body); eprintln!("---- END PARSED MESSAGE ----"); - let parsed = mail_parser::Message::parse(body).ok_or(())?; + let parsed = eml_codec::parse_message(body).or(Err(()))?.1; Ok(Self { raw: body, parsed }) } } |