From f3cebcfe0d010fe35dc159999a45c7816a68c9de Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:34:40 -0800 Subject: [PATCH] Derive default --- xmtp_mls/src/groups/group_permissions.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xmtp_mls/src/groups/group_permissions.rs b/xmtp_mls/src/groups/group_permissions.rs index fe2d14c44..bad0e66d5 100644 --- a/xmtp_mls/src/groups/group_permissions.rs +++ b/xmtp_mls/src/groups/group_permissions.rs @@ -345,8 +345,9 @@ pub(crate) fn policy_group_creator_is_admin() -> PolicySet { ) } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Default)] pub enum PreconfiguredPolicies { + #[default] EveryoneIsAdmin, GroupCreatorIsAdmin, } @@ -370,12 +371,6 @@ impl PreconfiguredPolicies { } } -impl Default for PreconfiguredPolicies { - fn default() -> Self { - PreconfiguredPolicies::EveryoneIsAdmin - } -} - impl std::fmt::Display for PreconfiguredPolicies { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "{:?}", self)