Refactor to async closures.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
cca0f20148
commit
c8d35cca57
36 changed files with 78 additions and 80 deletions
|
|
@ -19,7 +19,7 @@ pub(super) async fn list_rooms(
|
|||
.rooms
|
||||
.metadata
|
||||
.iter_ids()
|
||||
.filter_map(|room_id| async move {
|
||||
.filter_map(async |room_id| {
|
||||
(!exclude_disabled
|
||||
|| !self
|
||||
.services
|
||||
|
|
@ -29,7 +29,7 @@ pub(super) async fn list_rooms(
|
|||
.await)
|
||||
.then_some(room_id)
|
||||
})
|
||||
.filter_map(|room_id| async move {
|
||||
.filter_map(async |room_id| {
|
||||
(!exclude_banned
|
||||
|| !self
|
||||
.services
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ async fn list_joined_members(&self, room_id: OwnedRoomId, local_only: bool) -> R
|
|||
.unwrap_or(true)
|
||||
})
|
||||
.map(ToOwned::to_owned)
|
||||
.filter_map(|user_id| async move {
|
||||
.filter_map(async |user_id| {
|
||||
Some((
|
||||
self.services
|
||||
.users
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ async fn ban_room(&self, room: OwnedRoomOrAliasId) -> Result {
|
|||
.alias
|
||||
.local_aliases_for_room(&room_id)
|
||||
.map(ToOwned::to_owned)
|
||||
.for_each(|local_alias| async move {
|
||||
.for_each(async |local_alias| {
|
||||
self.services
|
||||
.rooms
|
||||
.alias
|
||||
|
|
@ -363,7 +363,7 @@ async fn ban_list_of_rooms(&self) -> Result {
|
|||
.alias
|
||||
.local_aliases_for_room(&room_id)
|
||||
.map(ToOwned::to_owned)
|
||||
.for_each(|local_alias| async move {
|
||||
.for_each(async |local_alias| {
|
||||
self.services
|
||||
.rooms
|
||||
.alias
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue