From 33793d878bdec26f62f0b07ce326e97139a2c5b4 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sat, 7 Dec 2019 23:46:00 +0100 Subject: [PATCH] address @link2xt comment on done/async --- src/imap/idle.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/imap/idle.rs b/src/imap/idle.rs index ecacaac6d..f3cea2183 100644 --- a/src/imap/idle.rs +++ b/src/imap/idle.rs @@ -96,9 +96,8 @@ impl Imap { } // if we can't properly terminate the idle // protocol let's break the connection. - let res = async_std::future::timeout(Duration::from_secs(15), async { - handle.done().await - }); + let res = + async_std::future::timeout(Duration::from_secs(15), handle.done()); match res.await { Ok(Ok(session)) => { *self.session.lock().await = Some(Session::Secure(session)); @@ -149,9 +148,8 @@ impl Imap { } // if we can't properly terminate the idle // protocol let's break the connection. - let res = async_std::future::timeout(Duration::from_secs(15), async { - handle.done().await - }); + let res = + async_std::future::timeout(Duration::from_secs(15), handle.done()); match res.await { Ok(Ok(session)) => { *self.session.lock().await = Some(Session::Insecure(session));