From 04e796176a7dd2bf33f04d49bcadbb54a3feb501 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sun, 31 Aug 2025 17:10:56 +0100 Subject: [PATCH] style(MSC4323): Satisfy our linting overlords --- src/api/client/admin/suspend.rs | 8 ++++---- src/api/client/capabilities.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/api/client/admin/suspend.rs b/src/api/client/admin/suspend.rs index 29682694..0d3493f6 100644 --- a/src/api/client/admin/suspend.rs +++ b/src/api/client/admin/suspend.rs @@ -14,10 +14,10 @@ pub(crate) async fn get_suspended_status( let sender_user = body.sender_user(); if !services.users.is_admin(sender_user).await { return Err!(Request(Forbidden("Only server administrators can use this endpoint"))); - }; + } if !services.globals.user_is_local(&body.user_id) { return Err!(Request(InvalidParam("Can only check the suspended status of local users"))); - }; + } if !services.users.is_active(&body.user_id).await { return Err!(Request(NotFound("Unknown user"))); } @@ -36,10 +36,10 @@ pub(crate) async fn put_suspended_status( let sender_user = body.sender_user(); if !services.users.is_admin(sender_user).await { return Err!(Request(Forbidden("Only server administrators can use this endpoint"))); - }; + } if !services.globals.user_is_local(&body.user_id) { return Err!(Request(InvalidParam("Can only set the suspended status of local users"))); - }; + } if !services.users.is_active(&body.user_id).await { return Err!(Request(NotFound("Unknown user"))); } diff --git a/src/api/client/capabilities.rs b/src/api/client/capabilities.rs index 2f9d6299..1fcb073f 100644 --- a/src/api/client/capabilities.rs +++ b/src/api/client/capabilities.rs @@ -19,14 +19,14 @@ use crate::Ruma; /// of this server. pub(crate) async fn get_capabilities_route( State(services): State, - _body: Ruma, + body: Ruma, ) -> Result { let available: BTreeMap = Server::available_room_versions().collect(); - let authenticated = _body.sender_user.as_ref().is_some() + let authenticated = body.sender_user.as_ref().is_some() && services .users - .is_active_local(_body.sender_user.as_ref().unwrap()) + .is_active_local(body.sender_user.as_ref().unwrap()) .await; let mut capabilities = Capabilities::default(); @@ -53,7 +53,7 @@ pub(crate) async fn get_capabilities_route( if authenticated && services .users - .is_admin(_body.sender_user.as_ref().unwrap()) + .is_admin(body.sender_user.as_ref().unwrap()) .await { // Advertise suspension API