From d43d141dc836cd7155449edb86012bb4d9d2c731 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 21 Aug 2025 10:09:17 +0300 Subject: [PATCH] chore(spaces): use `Client::joined_space_rooms` within the space service to reduce the number of iterations required --- crates/matrix-sdk-ui/src/spaces/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/matrix-sdk-ui/src/spaces/mod.rs b/crates/matrix-sdk-ui/src/spaces/mod.rs index fb2c212e6..7d5710f4a 100644 --- a/crates/matrix-sdk-ui/src/spaces/mod.rs +++ b/crates/matrix-sdk-ui/src/spaces/mod.rs @@ -173,11 +173,7 @@ impl SpaceService { } async fn joined_spaces_for(client: &Client) -> Vec { - let joined_spaces = client - .joined_rooms() - .into_iter() - .filter_map(|room| room.is_space().then_some(room)) - .collect::>(); + let joined_spaces = client.joined_space_rooms(); // Build a graph to hold the parent-child relations let mut graph = SpaceGraph::new();