refactor: iterate over msg_ids without .iter()

This commit is contained in:
link2xt
2023-05-10 14:32:38 +00:00
parent 15ce54edfb
commit 86472aba2c

View File

@@ -1399,8 +1399,8 @@ pub async fn get_mime_headers(context: &Context, msg_id: MsgId) -> Result<Vec<u8
/// by moving them to the trash chat
/// and scheduling for deletion on IMAP.
pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
for msg_id in msg_ids.iter() {
let msg = Message::load_from_db(context, *msg_id).await?;
for &msg_id in msg_ids {
let msg = Message::load_from_db(context, msg_id).await?;
if msg.location_id > 0 {
delete_poi_location(context, msg.location_id).await?;
}
@@ -1410,7 +1410,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
.with_context(|| format!("Unable to trash message {msg_id}"))?;
if msg.viewtype == Viewtype::Webxdc {
context.emit_event(EventType::WebxdcInstanceDeleted { msg_id: *msg_id });
context.emit_event(EventType::WebxdcInstanceDeleted { msg_id });
}
let target = context.get_delete_msgs_target().await?;
@@ -1430,7 +1430,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
.map(|dl| dl.msg_id);
if let Some(id) = logging_xdc_id {
if id == *msg_id {
if id == msg_id {
set_debug_logging_xdc(context, None).await?;
}
}