Enable unused_async clippy lint

This commit is contained in:
dasha_uwu
2026-01-10 09:08:48 +05:00
committed by Jason Volk
parent fd519ff7f1
commit d095a4fd3b
20 changed files with 60 additions and 64 deletions

View File

@@ -266,7 +266,6 @@ pub(crate) async fn register_route(
let skip_auth = if !services
.globals
.get_registration_tokens()
.await
.is_empty()
&& !is_guest
{
@@ -425,7 +424,7 @@ pub(crate) async fn check_registration_token_validity(
State(services): State<crate::State>,
body: Ruma<check_registration_token_validity::v1::Request>,
) -> Result<check_registration_token_validity::v1::Response> {
let tokens = services.globals.get_registration_tokens().await;
let tokens = services.globals.get_registration_tokens();
if tokens.is_empty() {
return Err!(Request(Forbidden("Server does not allow token registration")));

View File

@@ -10,7 +10,7 @@ use tuwunel_service::Services;
use crate::Ruma;
pub(super) async fn handle_login(
pub(super) fn handle_login(
services: &Services,
body: &Ruma<Request>,
info: &ApplicationService,

View File

@@ -115,7 +115,7 @@ pub(crate) async fn login_route(
| LoginInfo::Token(info) => token::handle_login(&services, &body, info).await?,
| LoginInfo::Jwt(info) => jwt::handle_login(&services, &body, info).await?,
| LoginInfo::ApplicationService(info) =>
appservice::handle_login(&services, &body, info).await?,
appservice::handle_login(&services, &body, info)?,
| _ => {
return Err!(Request(Unknown(debug_warn!(
?body.login_info,

View File

@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use axum::extract::State;
use futures::StreamExt;
use ruma::{
api::{
client::{error::ErrorKind, to_device::send_event_to_device},
@@ -9,7 +8,7 @@ use ruma::{
},
to_device::DeviceIdOrAllDevices,
};
use tuwunel_core::{Error, Result};
use tuwunel_core::{Error, Result, utils::ReadyExt};
use tuwunel_service::sending::EduBuf;
use crate::Ruma;
@@ -69,31 +68,27 @@ pub(crate) async fn send_event_to_device_route(
match target_device_id_maybe {
| DeviceIdOrAllDevices::DeviceId(target_device_id) => {
services
.users
.add_to_device_event(
sender_user,
target_user_id,
target_device_id,
event_type,
event,
)
.await;
services.users.add_to_device_event(
sender_user,
target_user_id,
target_device_id,
event_type,
&event,
);
},
| DeviceIdOrAllDevices::AllDevices => {
let (event_type, event) = (&event_type, &event);
services
.users
.all_device_ids(target_user_id)
.for_each(|target_device_id| {
.ready_for_each(|target_device_id| {
services.users.add_to_device_event(
sender_user,
target_user_id,
target_device_id,
event_type,
event.clone(),
)
&event,
);
})
.await;
},

View File

@@ -538,24 +538,27 @@ async fn handle_edu_direct_to_device_event(
) {
match target_device_id_maybe {
| DeviceIdOrAllDevices::DeviceId(ref target_device_id) => {
services
.users
.add_to_device_event(sender, target_user_id, target_device_id, ev_type, event)
.await;
services.users.add_to_device_event(
sender,
target_user_id,
target_device_id,
ev_type,
&event,
);
},
| DeviceIdOrAllDevices::AllDevices => {
services
.users
.all_device_ids(target_user_id)
.for_each(|target_device_id| {
.ready_for_each(|target_device_id| {
services.users.add_to_device_event(
sender,
target_user_id,
target_device_id,
ev_type,
event.clone(),
)
&event,
);
})
.await;
},