clippy allow -> expect

This commit is contained in:
dasha_uwu
2026-01-22 21:48:41 +05:00
committed by Jason Volk
parent fbedd713ca
commit 0c9a3abb71
91 changed files with 126 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
#![allow(deprecated)]
#![expect(deprecated)]
use axum::extract::State;
use axum_client_ip::InsecureClientIp;

View File

@@ -157,7 +157,7 @@ pub(crate) async fn get_pushrules_all_route(
// remove old deprecated mentions push rules as per MSC4210
// and update the stored server default push rules
#[allow(deprecated)]
#[expect(deprecated)]
{
use ruma::push::RuleKind::*;
if global_ruleset
@@ -245,7 +245,7 @@ pub(crate) async fn get_pushrules_global_route(
// remove old deprecated mentions push rules as per MSC4210
// and update the stored server default push rules
#[allow(deprecated)]
#[expect(deprecated)]
{
use ruma::push::RuleKind::*;
if global_ruleset
@@ -303,7 +303,7 @@ pub(crate) async fn get_pushrule_route(
.expect("user is authenticated");
// remove old deprecated mentions push rules as per MSC4210
#[allow(deprecated)]
#[expect(deprecated)]
if body.rule_id.as_str() == PredefinedContentRuleId::ContainsUserName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::ContainsDisplayName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::RoomNotif.as_str()
@@ -396,7 +396,7 @@ pub(crate) async fn get_pushrule_actions_route(
let sender_user = body.sender_user();
// remove old deprecated mentions push rules as per MSC4210
#[allow(deprecated)]
#[expect(deprecated)]
if body.rule_id.as_str() == PredefinedContentRuleId::ContainsUserName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::ContainsDisplayName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::RoomNotif.as_str()
@@ -463,7 +463,7 @@ pub(crate) async fn get_pushrule_enabled_route(
let sender_user = body.sender_user();
// remove old deprecated mentions push rules as per MSC4210
#[allow(deprecated)]
#[expect(deprecated)]
if body.rule_id.as_str() == PredefinedContentRuleId::ContainsUserName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::ContainsDisplayName.as_str()
|| body.rule_id.as_str() == PredefinedOverrideRuleId::RoomNotif.as_str()

View File

@@ -127,7 +127,7 @@ pub(crate) async fn get_register_available_route(
/// - Creates a new account and populates it with default account data
/// - If `inhibit_login` is false: Creates a device and returns device id and
/// access_token
#[allow(clippy::doc_markdown)]
#[expect(clippy::doc_markdown)]
#[tracing::instrument(skip_all, fields(%client), name = "register")]
pub(crate) async fn register_route(
State(services): State<crate::State>,

View File

@@ -108,7 +108,7 @@ pub(crate) async fn get_relating_events_route(
.await
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
#[tracing::instrument(
name = "relations",
level = "debug",

View File

@@ -55,7 +55,6 @@ use crate::{Ruma, client::utils::invite_check};
/// - Send events listed in initial state
/// - Send events implied by `name` and `topic`
/// - Send invite events
#[allow(clippy::large_stack_frames)]
pub(crate) async fn create_room_route(
State(services): State<crate::State>,
body: Ruma<create_room::v3::Request>,

View File

@@ -56,7 +56,7 @@ pub(crate) async fn search_events_route(
})
}
#[allow(clippy::map_unwrap_or)]
#[expect(clippy::map_unwrap_or)]
async fn category_room_events(
services: &Services,
sender_user: &UserId,

View File

@@ -15,7 +15,7 @@ pub(super) fn handle_login(
body: &Ruma<Request>,
info: &ApplicationService,
) -> Result<OwnedUserId> {
#[allow(deprecated)]
#[expect(deprecated)]
let ApplicationService { identifier, user } = info;
let Some(ref info) = body.appservice_info else {

View File

@@ -177,7 +177,7 @@ pub(crate) async fn login_route(
.map(HomeserverInfo::new)
.map(DiscoveryInfo::new);
#[allow(deprecated)]
#[expect(deprecated)]
Ok(login::v3::Response {
user_id,
access_token,

View File

@@ -17,7 +17,7 @@ pub(super) async fn handle_login(
body: &Ruma<Request>,
info: &Password,
) -> Result<OwnedUserId> {
#[allow(deprecated)]
#[expect(deprecated)]
let Password { identifier, password, user, .. } = info;
let user_id = if let Some(uiaa::UserIdentifier::UserIdOrLocalpart(user_id)) = identifier {

View File

@@ -525,7 +525,6 @@ async fn process_presence_updates(
full = %full_state,
),
)]
#[allow(clippy::too_many_arguments)]
async fn handle_left_room(
services: &Services,
since: u64,
@@ -744,7 +743,7 @@ async fn load_left_room(
room_id = ?room_id,
),
)]
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
async fn load_joined_room(
services: &Services,
sender_user: &UserId,
@@ -1163,7 +1162,7 @@ async fn load_joined_room(
cs = %current_shortstatehash,
)
)]
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
async fn calculate_state_changes<'a>(
services: &Services,
sender_user: &UserId,

View File

@@ -21,7 +21,7 @@ pub(super) async fn filter_room(
room_id: &RoomId,
membership: Option<&MembershipState>,
) -> bool {
#[allow(clippy::match_same_arms)] // helps readability
#[expect(clippy::match_same_arms)] // helps readability
let match_invite = filter
.is_invite
.map_async(async |is_invite| match (membership, is_invite) {

View File

@@ -73,7 +73,6 @@ pub(super) async fn handle(
skip_all,
fields(room_id, roomsince)
)]
#[allow(clippy::too_many_arguments)]
async fn handle_room(
SyncInfo { services, sender_user, .. }: SyncInfo<'_>,
conn: &Connection,
@@ -360,7 +359,6 @@ async fn handle_room(
}
#[tracing::instrument(name = "heroes", level = "trace", skip_all)]
#[allow(clippy::type_complexity)]
async fn calculate_heroes(
services: &Services,
sender_user: &UserId,