From f9f410675706aa76001f80fc54d3f3a4828fbc17 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 4 Sep 2021 01:12:35 +0200 Subject: [PATCH] state-res: Don't call .to_string() for server name comparison --- crates/ruma-state-res/src/event_auth.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruma-state-res/src/event_auth.rs b/crates/ruma-state-res/src/event_auth.rs index 928869aa..8f39823c 100644 --- a/crates/ruma-state-res/src/event_auth.rs +++ b/crates/ruma-state-res/src/event_auth.rs @@ -192,7 +192,7 @@ where info!("starting m.room.aliases check"); // If sender's domain doesn't matches state_key, reject - if incoming_event.state_key() != Some(sender.server_name().to_string()) { + if incoming_event.state_key().as_deref() != Some(sender.server_name().as_str()) { warn!("state_key does not match sender"); return Ok(false); }