aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-03 17:37:39 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-03 17:37:39 +0200
commite950931c5f145c05353aa377f99fb2daac37d044 (patch)
tree2c7fd58299432853ec905cd5f7a2ab7376de5fba /src/server.rs
parent3589b0fa4b290ebbe416d793b9f82673754ab6f9 (diff)
downloadaerogramme-e950931c5f145c05353aa377f99fb2daac37d044.tar.gz
aerogramme-e950931c5f145c05353aa377f99fb2daac37d044.zip
Run cargo fmt
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/server.rs b/src/server.rs
index 4fe5f12..8a9b7a3 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -2,8 +2,8 @@ use anyhow::Result;
use std::sync::Arc;
use crate::config::*;
-use crate::mailstore;
use crate::instance;
+use crate::mailstore;
use boitalettres::server::accept::addr::AddrIncoming;
use boitalettres::server::Server as ImapServer;
@@ -14,7 +14,7 @@ pub struct Server {
}
impl Server {
pub async fn new(config: Config) -> Result<Self> {
- Ok(Self {
+ Ok(Self {
incoming: AddrIncoming::new("127.0.0.1:4567").await?,
mailstore: mailstore::Mailstore::new(config)?,
})
@@ -23,15 +23,18 @@ impl Server {
pub async fn run(self: Self) -> Result<()> {
tracing::info!("Starting server on {:#}", self.incoming.local_addr);
-
- let creds = self.mailstore.login_provider.login("quentin", "poupou").await?;
+ let creds = self
+ .mailstore
+ .login_provider
+ .login("quentin", "poupou")
+ .await?;
//let mut mailbox = Mailbox::new(&creds, "TestMailbox".to_string()).await?;
//mailbox.test().await?;
- let server = ImapServer::new(self.incoming).serve(instance::Instance::new(self.mailstore.clone()));
+ let server =
+ ImapServer::new(self.incoming).serve(instance::Instance::new(self.mailstore.clone()));
let _ = server.await?;
-
Ok(())
}
}