Introduce OptionFuture helpers

Optimize user directory searches
This commit is contained in:
dasha_uwu
2026-01-17 05:38:09 +05:00
committed by Jason Volk
parent 95121ad905
commit e78bf21085
28 changed files with 454 additions and 567 deletions

View File

@@ -8,7 +8,7 @@ use ruma::{
use tuwunel_core::{
Result,
utils::{
future::BoolExt,
BoolExt, FutureBoolExt,
stream::{BroadbandExt, ReadyExt},
},
};
@@ -52,11 +52,12 @@ pub(crate) async fn search_users_route(
&search_term,
)
.await
.then_some(search_users::v3::User {
.then_async(async || search_users::v3::User {
user_id: user_id.clone(),
display_name,
avatar_url: services.users.avatar_url(&user_id).await.ok(),
})
.await
});
pin_mut!(users);