mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
fetch_single_msg: use if let Some(...) instead of is_empty()
This commit is contained in:
committed by
holger krekel
parent
793ebe1b0f
commit
08c77c2668
@@ -755,16 +755,7 @@ impl Imap {
|
|||||||
return Err(Error::Other("Could not get IMAP session".to_string()));
|
return Err(Error::Other("Could not get IMAP session".to_string()));
|
||||||
};
|
};
|
||||||
|
|
||||||
if msgs.is_empty() {
|
if let Some(msg) = msgs.first() {
|
||||||
warn!(
|
|
||||||
context,
|
|
||||||
"Message #{} does not exist in folder \"{}\".",
|
|
||||||
server_uid,
|
|
||||||
folder.as_ref()
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
let msg = &msgs[0];
|
|
||||||
|
|
||||||
// XXX put flags into a set and pass them to dc_receive_imf
|
// XXX put flags into a set and pass them to dc_receive_imf
|
||||||
let is_deleted = msg.flags().any(|flag| match flag {
|
let is_deleted = msg.flags().any(|flag| match flag {
|
||||||
Flag::Deleted => true,
|
Flag::Deleted => true,
|
||||||
@@ -789,6 +780,13 @@ impl Imap {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warn!(
|
||||||
|
context,
|
||||||
|
"Message #{} does not exist in folder \"{}\".",
|
||||||
|
server_uid,
|
||||||
|
folder.as_ref()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user