diff --git a/daemon/src/config/watcher.rs b/daemon/src/config/watcher.rs index 4a03b13..4faaf54 100644 --- a/daemon/src/config/watcher.rs +++ b/daemon/src/config/watcher.rs @@ -1,5 +1,5 @@ use std::fs; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::sync::mpsc as stdmpsc; use std::time::Duration; @@ -8,10 +8,7 @@ use futures::future::TryFutureExt; use notify::{ watcher, DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher, }; -use tokio::{ - sync::{mpsc, watch}, - task::JoinHandle, -}; +use tokio::{sync::watch, task::JoinHandle}; use xdg::BaseDirectories; use super::Config; @@ -46,7 +43,7 @@ pub fn spawn_config_watcher_system() -> Result<(JoinHandle<()>, ConfigWatcher)> } async fn start_notify_stream( - mut watcher: RecommendedWatcher, + _watcher: RecommendedWatcher, rx: stdmpsc::Receiver, config_home: impl AsRef, config_tx: watch::Sender, diff --git a/daemon/src/mail/store.rs b/daemon/src/mail/store.rs index af0572f..38e2f83 100644 --- a/daemon/src/mail/store.rs +++ b/daemon/src/mail/store.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{Context, Result}; use sqlx::sqlite::{SqlitePool, SqlitePoolOptions}; use super::MIGRATOR; @@ -13,7 +13,10 @@ impl MailStore { let pool = SqlitePoolOptions::new().connect(uri.as_ref()).await?; // run migrations, if available - MIGRATOR.run(&pool).await?; + MIGRATOR + .run(&pool) + .await + .context("could not run migrations on the pool")?; Ok(MailStore { pool }) } diff --git a/daemon/src/main.rs b/daemon/src/main.rs index c6ed7e3..4cfa0db 100644 --- a/daemon/src/main.rs +++ b/daemon/src/main.rs @@ -5,16 +5,11 @@ extern crate futures; use anyhow::{Context, Result}; use clap::Clap; -use futures::future::{ - select, - Either::{Left, Right}, - FutureExt, -}; +use futures::future::FutureExt; use panorama_daemon::{ - config::{Config, MailAccountConfig, TlsMethod}, + config::{Config, MailAccountConfig}, mail::{sync_main, MailStore}, }; -use panorama_imap::client::ConfigBuilder; use tokio::{ fs::{self, OpenOptions}, sync::{mpsc, oneshot}, diff --git a/imap/src/client/inner.rs b/imap/src/client/inner.rs index d383624..6a328e9 100644 --- a/imap/src/client/inner.rs +++ b/imap/src/client/inner.rs @@ -154,7 +154,7 @@ where std::mem::drop(read); let cmd = self.execute(Command::Capability).await?; - let (done, res) = cmd.wait().await?; + let (_, res) = cmd.wait().await?; let mut capabilities = HashSet::new(); // todo!("done: {:?} {:?}", done, res); @@ -193,10 +193,9 @@ where .execute(Command::Starttls) .await .context("could not send starttls command")?; - dbg!(resp - .wait() + resp.wait() .await - .context("could not receive starttls response")?); + .context("could not receive starttls response")?; debug!("received OK from server"); // issue exit to the read loop and retrieve the read half diff --git a/imap/src/proto/command.rs b/imap/src/proto/command.rs index f6f98be..83ac12f 100644 --- a/imap/src/proto/command.rs +++ b/imap/src/proto/command.rs @@ -90,7 +90,7 @@ impl DisplayBytes for Command { #[cfg(feature = "rfc2177")] Command::Idle => write_bytes!(w, b"IDLE"), - _ => todo!("unimplemented command"), + _ => todo!("unimplemented command: {:?}", self), } } } @@ -167,7 +167,7 @@ impl DisplayBytes for FetchItems { FetchItems::Fast => write_bytes!(w, b"FAST"), FetchItems::Full => write_bytes!(w, b"FULL"), FetchItems::Flags => write_bytes!(w, b"FLAGS"), - FetchItems::Envelope => write_bytes!(w, b"ENVEOPE"), + FetchItems::Envelope => write_bytes!(w, b"ENVELOPE"), } } }