mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 22:16:30 +03:00
imap: simplify select_folder() interface
Accept AsRef<str> instead of Option<impl AsRef<str>>. There is no need to pass None to force expunge anymore.
This commit is contained in:
committed by
link2xt
parent
c41a6b87b8
commit
e8763e936d
@@ -59,7 +59,7 @@ impl Imap {
|
||||
task::block_on(async move { self.config.read().await.can_idle })
|
||||
}
|
||||
|
||||
pub fn idle(&self, context: &Context, watch_folder: Option<String>) -> Result<()> {
|
||||
pub fn idle(&self, context: &Context, watch_folder: String) -> Result<()> {
|
||||
task::block_on(async move {
|
||||
if !self.can_idle() {
|
||||
return Err(Error::IdleAbilityMissing);
|
||||
@@ -67,7 +67,7 @@ impl Imap {
|
||||
|
||||
self.setup_handle_if_needed(context).await?;
|
||||
|
||||
self.select_folder(context, watch_folder.clone()).await?;
|
||||
self.select_folder(context, watch_folder).await?;
|
||||
|
||||
let session = self.session.lock().await.take();
|
||||
let timeout = Duration::from_secs(23 * 60);
|
||||
|
||||
Reference in New Issue
Block a user