mirror of
https://github.com/terhechte/postsack
synced 2024-11-10 07:10:38 +00:00
Some cleanup
This commit is contained in:
parent
471517047a
commit
158b6995a7
@ -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<Vec<RawEmailEntry>> {
|
|
||||||
Ok(folders_in(
|
|
||||||
&config.emails_folder_path,
|
|
||||||
sender,
|
|
||||||
|path, sender| emails_in(path, sender, RawEmailEntry::new),
|
|
||||||
)?)
|
|
||||||
}
|
|
@ -1,8 +1,9 @@
|
|||||||
mod filesystem;
|
|
||||||
mod meta;
|
mod meta;
|
||||||
mod raw_email;
|
mod raw_email;
|
||||||
|
|
||||||
|
use super::shared::filesystem::{emails_in, folders_in};
|
||||||
use super::{Config, ImporterFormat, MessageSender, Result};
|
use super::{Config, ImporterFormat, MessageSender, Result};
|
||||||
|
use raw_email::RawEmailEntry;
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Gmail {}
|
pub struct Gmail {}
|
||||||
@ -10,6 +11,10 @@ pub struct Gmail {}
|
|||||||
impl ImporterFormat for Gmail {
|
impl ImporterFormat for Gmail {
|
||||||
type Item = raw_email::RawEmailEntry;
|
type Item = raw_email::RawEmailEntry;
|
||||||
fn emails(&self, config: &Config, sender: MessageSender) -> Result<Vec<Self::Item>> {
|
fn emails(&self, config: &Config, sender: MessageSender) -> Result<Vec<Self::Item>> {
|
||||||
filesystem::read_emails(config, sender)
|
Ok(folders_in(
|
||||||
|
&config.emails_folder_path,
|
||||||
|
sender,
|
||||||
|
|path, sender| emails_in(path, sender, RawEmailEntry::new),
|
||||||
|
)?)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user