From 158b6995a7edb3f2d65d7ac604512a30d62e2c9d Mon Sep 17 00:00:00 2001 From: Benedikt Terhechte Date: Sun, 10 Oct 2021 08:05:56 +0200 Subject: [PATCH] Some cleanup --- src/importer/formats/gmailbackup/filesystem.rs | 14 -------------- src/importer/formats/gmailbackup/mod.rs | 9 +++++++-- 2 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 src/importer/formats/gmailbackup/filesystem.rs diff --git a/src/importer/formats/gmailbackup/filesystem.rs b/src/importer/formats/gmailbackup/filesystem.rs deleted file mode 100644 index b83aa12..0000000 --- a/src/importer/formats/gmailbackup/filesystem.rs +++ /dev/null @@ -1,14 +0,0 @@ -use eyre::Result; - -use super::super::shared::filesystem::{emails_in, folders_in}; -use super::super::MessageSender; -use super::raw_email::RawEmailEntry; -use crate::types::Config; - -pub fn read_emails(config: &Config, sender: MessageSender) -> Result> { - Ok(folders_in( - &config.emails_folder_path, - sender, - |path, sender| emails_in(path, sender, RawEmailEntry::new), - )?) -} diff --git a/src/importer/formats/gmailbackup/mod.rs b/src/importer/formats/gmailbackup/mod.rs index f4d105d..df209f2 100644 --- a/src/importer/formats/gmailbackup/mod.rs +++ b/src/importer/formats/gmailbackup/mod.rs @@ -1,8 +1,9 @@ -mod filesystem; mod meta; mod raw_email; +use super::shared::filesystem::{emails_in, folders_in}; use super::{Config, ImporterFormat, MessageSender, Result}; +use raw_email::RawEmailEntry; #[derive(Default)] pub struct Gmail {} @@ -10,6 +11,10 @@ pub struct Gmail {} impl ImporterFormat for Gmail { type Item = raw_email::RawEmailEntry; fn emails(&self, config: &Config, sender: MessageSender) -> Result> { - filesystem::read_emails(config, sender) + Ok(folders_in( + &config.emails_folder_path, + sender, + |path, sender| emails_in(path, sender, RawEmailEntry::new), + )?) } }