matrix-sdk: handle overflow in active_members_count
parent
24e96df7ea
commit
f8bc9f3dc9
|
@ -535,7 +535,11 @@ impl RoomInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The number of active members (invited + joined) in the room.
|
/// The number of active members (invited + joined) in the room.
|
||||||
|
///
|
||||||
|
/// The return value is saturated at `u64::MAX`.
|
||||||
pub fn active_members_count(&self) -> u64 {
|
pub fn active_members_count(&self) -> u64 {
|
||||||
self.summary.joined_member_count + self.summary.invited_member_count
|
self.summary
|
||||||
|
.joined_member_count
|
||||||
|
.saturating_add(self.summary.invited_member_count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue