mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
refactor: use try_next() when processing FETCH responses
This commit is contained in:
@@ -1384,14 +1384,15 @@ impl Session {
|
|||||||
|
|
||||||
// Try to find a requested UID in returned FETCH responses.
|
// Try to find a requested UID in returned FETCH responses.
|
||||||
while fetch_response.is_none() {
|
while fetch_response.is_none() {
|
||||||
let Some(next_fetch_response) = fetch_responses.next().await else {
|
let Some(next_fetch_response) = fetch_responses
|
||||||
|
.try_next()
|
||||||
|
.await
|
||||||
|
.context("Failed to process IMAP FETCH result")?
|
||||||
|
else {
|
||||||
// No more FETCH responses received from the server.
|
// No more FETCH responses received from the server.
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
let next_fetch_response =
|
|
||||||
next_fetch_response.context("Failed to process IMAP FETCH result")?;
|
|
||||||
|
|
||||||
if let Some(next_uid) = next_fetch_response.uid {
|
if let Some(next_uid) = next_fetch_response.uid {
|
||||||
if next_uid == request_uid {
|
if next_uid == request_uid {
|
||||||
fetch_response = Some(next_fetch_response);
|
fetch_response = Some(next_fetch_response);
|
||||||
|
|||||||
Reference in New Issue
Block a user