From 1a4b7903b85d392252c653df9d525647c0c15a5f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 4 Sep 2021 12:28:52 +0200 Subject: [PATCH] state-res: Replace if let with match --- crates/ruma-state-res/src/event_auth.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/ruma-state-res/src/event_auth.rs b/crates/ruma-state-res/src/event_auth.rs index 36fc2f0d..eb56150c 100644 --- a/crates/ruma-state-res/src/event_auth.rs +++ b/crates/ruma-state-res/src/event_auth.rs @@ -604,11 +604,10 @@ where } } - let current_state = if let Some(current_state) = previous_power_event { - current_state - } else { + let current_state = match previous_power_event { + Some(current_state) => current_state, // If there is no previous m.room.power_levels event in the room, allow - return Some(true); + None => return Some(true), }; // If users key in content is not a dictionary with keys that are valid user IDs