room/broadcast_presence: move matches! blocks together

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-09-28 18:07:59 +02:00
parent d7c4bcd87b
commit bcc2f7d85e

View file

@ -75,6 +75,8 @@ impl Room {
mode: BroadcastPresence,
) -> Result<(), Error> {
let leave = matches!(mode, BroadcastPresence::Leave);
let sync = matches!(mode, BroadcastPresence::Join | BroadcastPresence::Resync);
let update = matches!(mode, BroadcastPresence::Join | BroadcastPresence::Update);
// All participants to new participant
let presence_to_new = Presence::new(if leave {
@ -105,9 +107,6 @@ impl Room {
}
.into()]);
let sync = matches!(mode, BroadcastPresence::Join | BroadcastPresence::Resync);
let update = matches!(mode, BroadcastPresence::Join | BroadcastPresence::Update);
for (_, other) in self.occupants.iter() {
if own_occupant.nick == other.nick {
continue;