From a3ba19db962056900c3ce730871e15bb02beb399 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 19 Mar 2022 16:53:21 +0000 Subject: [PATCH] Resultify delete_poi_location() --- src/message.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/message.rs b/src/message.rs index 8ab6552df..d3e200dcf 100644 --- a/src/message.rs +++ b/src/message.rs @@ -1236,7 +1236,7 @@ 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?; if msg.location_id > 0 { - delete_poi_location(context, msg.location_id).await; + delete_poi_location(context, msg.location_id).await?; } msg_id .trash(context) @@ -1269,15 +1269,15 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> { Ok(()) } -async fn delete_poi_location(context: &Context, location_id: u32) -> bool { +async fn delete_poi_location(context: &Context, location_id: u32) -> Result<()> { context .sql .execute( "DELETE FROM locations WHERE independent = 1 AND id=?;", paramsv![location_id as i32], ) - .await - .is_ok() + .await?; + Ok(()) } pub async fn markseen_msgs(context: &Context, msg_ids: Vec) -> Result<()> {