diff --git a/matrix_sdk_base/src/rooms/mod.rs b/matrix_sdk_base/src/rooms/mod.rs index 39121d80..30d7bc2e 100644 --- a/matrix_sdk_base/src/rooms/mod.rs +++ b/matrix_sdk_base/src/rooms/mod.rs @@ -63,14 +63,15 @@ impl BaseRoomInfo { heroes: Vec, ) -> String { let heroes_count = heroes.len() as u64; - let invited_joined = (invited_member_count + joined_member_count).saturating_sub(1); + let invited_joined = invited_member_count + joined_member_count; + let invited_joined_minus_one = invited_joined.saturating_sub(1); - if heroes_count >= invited_joined { + if heroes_count >= invited_joined_minus_one { let mut names = heroes.iter().take(3).map(|mem| mem.name()).collect::>(); // stabilize ordering names.sort_unstable(); names.join(", ") - } else if heroes_count < invited_joined && invited_joined > 1 { + } else if heroes_count < invited_joined_minus_one && invited_joined > 1 { let mut names = heroes.iter().take(3).map(|mem| mem.name()).collect::>(); names.sort_unstable();