From bcc2f7d85e8c7ea5fe1a9446395743770369e96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 28 Sep 2022 18:07:59 +0200 Subject: [PATCH] room/broadcast_presence: move matches! blocks together MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- src/room.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/room.rs b/src/room.rs index 481ddf2..b8f880e 100644 --- a/src/room.rs +++ b/src/room.rs @@ -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;