From 922059c3e51b28a85c87f84989588c90c2ce9562 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 22 Mar 2021 20:53:14 +0100 Subject: [PATCH] common: Borrow the rule ID in AnyPushRule::rule_id --- ruma-common/src/push.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ruma-common/src/push.rs b/ruma-common/src/push.rs index d2e7f6dc..ef07d093 100644 --- a/ruma-common/src/push.rs +++ b/ruma-common/src/push.rs @@ -141,14 +141,14 @@ pub enum AnyPushRule { } impl AnyPushRule { - /// The `rule_id` of the push rule - pub fn rule_id(&self) -> String { + /// Get the `rule_id` of the push rule. + pub fn rule_id(&self) -> &str { match self { - Self::Override(rule) => rule.rule_id.clone(), - Self::Underride(rule) => rule.rule_id.clone(), - Self::Content(rule) => rule.rule_id.clone(), - Self::Room(rule) => rule.rule_id.clone(), - Self::Sender(rule) => rule.rule_id.clone(), + Self::Override(rule) => &rule.rule_id, + Self::Underride(rule) => &rule.rule_id, + Self::Content(rule) => &rule.rule_id, + Self::Room(rule) => &rule.rule_id, + Self::Sender(rule) => &rule.rule_id, } } }