From 6f28cbc9b639e2364fed447640917b7e611dc72d Mon Sep 17 00:00:00 2001 From: Simon Westlin Green Date: Wed, 6 Nov 2024 20:03:35 +0100 Subject: [PATCH] replaced map_err with inspect_err since we do not modify the error in any way --- backend/src/handlers/session.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/src/handlers/session.rs b/backend/src/handlers/session.rs index dd73ee1..04454b9 100644 --- a/backend/src/handlers/session.rs +++ b/backend/src/handlers/session.rs @@ -73,19 +73,16 @@ async fn update_sessions( user_session_repo .update_sessions(&user_ids) .await - .map_err(|e| { - warn!("[Update sessions] Could not update user sessions"); - e - })?; + .inspect_err(|_e| warn!("[Update sessions] Could not update user sessions"))?; let devices = devices .into_iter() .map(|device| (device.user_id, device.address)) .collect::>(); - session_repo.update_sessions(&devices).await.map_err(|e| { - warn!("[Update sessions] Could not update sessions"); - e - })?; + session_repo + .update_sessions(&devices) + .await + .inspect_err(|_e| warn!("[Update sessions] Could not update sessions"))?; Ok(HttpResponse::Ok().finish()) }