diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-07-23 15:30:48 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-07-23 15:30:48 +0200 |
commit | 0a9f080dd961d2be6e6e6322f4912a46227f3fca (patch) | |
tree | 13c3764c5903a21036713d8bf199ee1b62ee76e8 /src | |
parent | 62cfbde13e1fad13278da726429b649b6921c60b (diff) |
Remove unused type
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/mail.rs | 35 | ||||
-rw-r--r-- | src/main.rs | 1 |
2 files changed, 0 insertions, 36 deletions
diff --git a/src/mail.rs b/src/mail.rs deleted file mode 100644 index c818a3d..0000000 --- a/src/mail.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::path::PathBuf; -use anyhow::Result; -use anyhow::Error; -use mailparse::ParsedMail; - -#[derive(Clone, Debug)] -pub struct Mail { - id: String, - buffer: Vec<u8>, - parsed: ParsedMail, -} - -impl Mail { - pub fn read_from_path(id: String, pb: PathBuf) -> Result<Self> { - std::fs::read(pb) - .map_err(Error::from) - .and_then(|buffer| { - mailparse::parse_mail(buffer.clone()) - .map(|parsed| (buffer, parsed)) - .map_err(Error::from) - }) - .map(|(buffer, parsed)| Mail { id, buffer, parsed }) - } - - pub fn parsed(&self) -> &ParsedMail { - &self.parsed - } - - pub fn id(&self) -> &String { - &self.id - } - -} - - diff --git a/src/main.rs b/src/main.rs index 8de716c..3291db7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,6 @@ use cursive::event::{Event, EventTrigger}; mod main_view; mod maillist_view; -mod mail; mod configuration; use configuration::Configuration; |